xenfra-sdk 0.2.6__py3-none-any.whl → 0.2.7__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.
xenfra_sdk/engine.py CHANGED
@@ -25,7 +25,7 @@ from .exceptions import DeploymentError
25
25
  from .governance import get_polling_interval, get_resource_limits
26
26
  from .models.context import DeploymentContext
27
27
  from .blueprints.factory import render_blueprint
28
- # from .devbox import DevboxHarness # Removed
28
+ from .client import XenfraClient
29
29
 
30
30
  class InfraEngine:
31
31
  """
@@ -58,6 +58,8 @@ class InfraEngine:
58
58
  logger=self.context.get("logger"),
59
59
  event_callback=self.context.get("event_callback")
60
60
  )
61
+ # Initialize internal client for API access (Intelligence/Sandbox)
62
+ self.client = XenfraClient(token=self.token)
61
63
 
62
64
  def _get_connection(self, ip_address: str):
63
65
  """Establishes a Fabric connection to the server."""
@@ -862,14 +864,21 @@ class InfraEngine:
862
864
  # === ZEN MODE: PRE-MITOSIS (E2B GATE) ===
863
865
  # Replaced by Secure Ralph Loop (server-side Firecracker verification)
864
866
  # Enforce "No Compromise" - Verify before Deploy
865
- if verify_local and not dry_run:
867
+ # Fix: Mandatory enforcement (no verify_local conditional)
868
+ if not dry_run:
866
869
  logger("\n[bold yellow]🛡️ E2B GATE: Verifying build in Cloud Sandbox...[/bold yellow]")
867
870
  # Call Intelligence Service to verify
868
871
  try:
869
- # This presumes we have access to the intelligence client
870
- # For now, we simulate the "No Compromise" check or call via HTTP
871
- # In a real run, we would POST to /intelligence/verify with the assets
872
- pass
872
+ # Check with the Intelligence service using the client
873
+ logger(" - Submitting audit package to Intelligence Service...")
874
+ result = self.client.intelligence.verify(
875
+ logs="PRE-DEPLOYMENT AUDIT",
876
+ code_snippets=[{"path": k, "content": v} for k, v in ctx_dict.get("file_manifest", [])]
877
+ )
878
+
879
+ if result.get("status") == "failed":
880
+ raise Exception(f"Sandbox verification failed: {result.get('error')}")
881
+
873
882
  logger(" - [Verified] E2B Sandbox check passed.")
874
883
  except Exception as e:
875
884
  raise DeploymentError(f"E2B Verification Failed: {e}", stage="Pre-Mitosis")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: xenfra-sdk
3
- Version: 0.2.6
3
+ Version: 0.2.7
4
4
  Summary: Xenfra SDK: Core engine and utilities for the Xenfra platform.
5
5
  Author: xenfra-cloud
6
6
  Author-email: xenfra-cloud <xenfracloud@gmail.com>
@@ -17,7 +17,7 @@ xenfra_sdk/db/session.py,sha256=Cryt02u01Lq_olwOji3X9a5pI7lE5p0O0mKX3na9h6M,879
17
17
  xenfra_sdk/dependencies.py,sha256=WHGfIrEYkss5yuBd_uOFrB6lPBWM2X0mEuG26ILAjXI,1211
18
18
  xenfra_sdk/detection.py,sha256=7DDfwOAfmZYF5tzJAcbUsME8alfsqS0HQgrI4eTfwTA,18913
19
19
  xenfra_sdk/dockerizer.py,sha256=iSn-HZ2-07zgM-C2aQkJH-MBtPrkEimurKLY9hth34Y,5191
20
- xenfra_sdk/engine.py,sha256=nmrjFKaYsouHvfFThYo4gXTuoCr0Xr2zgFy35XcfIKo,67310
20
+ xenfra_sdk/engine.py,sha256=Bon5OgrZcd7puNIPhva_FX2LLu5u-5Eg_3CES8vXLUQ,67812
21
21
  xenfra_sdk/events.py,sha256=7BgtTc4a-bw6ybicQblQ-Y0CGbUpgR_Cx4YNaJi_SsU,8013
22
22
  xenfra_sdk/exceptions.py,sha256=rNUpuk6NXsigqBUNMqzit48DjvZev5Try87zVT8ethE,753
23
23
  xenfra_sdk/governance.py,sha256=g9bN174HeoA13Cv-8o6hoVK_dRcrnHOBVRdKkZE9pWY,3784
@@ -44,6 +44,6 @@ xenfra_sdk/resources/projects.py,sha256=EsCVXmqkhWl_Guz_8WDQDi3kAm1Wyg1rjXcyAigP
44
44
  xenfra_sdk/security.py,sha256=6vMZpbglhkRGBVVj4RCTu45-MCnQ15wt94-996zmaT8,1199
45
45
  xenfra_sdk/security_scanner.py,sha256=US9QdMjHdTUkqObrGPHvDPxMP0QXCxmwK5e28d8KT2E,12957
46
46
  xenfra_sdk/utils.py,sha256=d8eCjjV32QwqoJa759CEcETnnsjG5qVKDLQ84yYtlus,3898
47
- xenfra_sdk-0.2.6.dist-info/WHEEL,sha256=5DEXXimM34_d4Gx1AuF9ysMr1_maoEtGKjaILM3s4w4,80
48
- xenfra_sdk-0.2.6.dist-info/METADATA,sha256=PsSEAuYqDKMuXabOgzvPOY_E80jdsDFjSyw_3JdNIRo,3889
49
- xenfra_sdk-0.2.6.dist-info/RECORD,,
47
+ xenfra_sdk-0.2.7.dist-info/WHEEL,sha256=5DEXXimM34_d4Gx1AuF9ysMr1_maoEtGKjaILM3s4w4,80
48
+ xenfra_sdk-0.2.7.dist-info/METADATA,sha256=d-Y9T0-E3WFHvU3s8TIzQX81E5RPFGOc3vuj5vgs8m0,3889
49
+ xenfra_sdk-0.2.7.dist-info/RECORD,,