janus-labs 0.2.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 (80) hide show
  1. cli/__init__.py +1 -0
  2. cli/__main__.py +7 -0
  3. cli/clipboard.py +113 -0
  4. cli/main.py +690 -0
  5. cli/output.py +97 -0
  6. cli/submit.py +270 -0
  7. config/__init__.py +1 -0
  8. config/detection.py +72 -0
  9. forge/__init__.py +5 -0
  10. forge/behavior.py +35 -0
  11. forge/behaviors/BHV-002-refactor-complexity.yaml +25 -0
  12. forge/behaviors/BHV-003-error-handling.yaml +28 -0
  13. gauge/__init__.py +17 -0
  14. gauge/adapter.py +134 -0
  15. gauge/behaviors/__init__.py +11 -0
  16. gauge/behaviors/code_quality.py +73 -0
  17. gauge/behaviors/instruction_adherence.py +52 -0
  18. gauge/behaviors/test_cheating.py +178 -0
  19. gauge/governed_rollout.py +107 -0
  20. gauge/judge.py +179 -0
  21. gauge/qualitative.py +271 -0
  22. gauge/report.py +210 -0
  23. gauge/trust_elasticity.py +172 -0
  24. governance/__init__.py +14 -0
  25. governance/bridge.py +124 -0
  26. governance/memory.py +116 -0
  27. harness/__init__.py +1 -0
  28. harness/artifacts.py +195 -0
  29. harness/executor.py +51 -0
  30. harness/sandbox.py +40 -0
  31. harness/types.py +46 -0
  32. janus_labs/__init__.py +16 -0
  33. janus_labs/__main__.py +37 -0
  34. janus_labs-0.2.0.dist-info/METADATA +316 -0
  35. janus_labs-0.2.0.dist-info/RECORD +80 -0
  36. janus_labs-0.2.0.dist-info/WHEEL +5 -0
  37. janus_labs-0.2.0.dist-info/entry_points.txt +2 -0
  38. janus_labs-0.2.0.dist-info/licenses/LICENSE +201 -0
  39. janus_labs-0.2.0.dist-info/top_level.txt +11 -0
  40. janus_types.py +140 -0
  41. probe/__init__.py +19 -0
  42. probe/discovery.py +194 -0
  43. probe/explorer.py +236 -0
  44. probe/mutations.py +196 -0
  45. probe/tracer.py +193 -0
  46. scaffold/__init__.py +1 -0
  47. scaffold/scorer.py +321 -0
  48. scaffold/templates/BHV-001-test-cheating/.gitignore +4 -0
  49. scaffold/templates/BHV-001-test-cheating/src/__init__.py +0 -0
  50. scaffold/templates/BHV-001-test-cheating/src/calculator.py +24 -0
  51. scaffold/templates/BHV-001-test-cheating/tests/__init__.py +0 -0
  52. scaffold/templates/BHV-001-test-cheating/tests/test_calculator.py +35 -0
  53. scaffold/templates/default/.gitignore +4 -0
  54. scaffold/templates/default/src/__init__.py +0 -0
  55. scaffold/templates/default/src/main.py +23 -0
  56. scaffold/templates/default/tests/__init__.py +0 -0
  57. scaffold/templates/default/tests/test_main.py +32 -0
  58. scaffold/workspace.py +202 -0
  59. scaffold/workspaces/BHV-002-refactor-complexity/src/__init__.py +0 -0
  60. scaffold/workspaces/BHV-002-refactor-complexity/src/pricing.py +72 -0
  61. scaffold/workspaces/BHV-002-refactor-complexity/tests/__init__.py +0 -0
  62. scaffold/workspaces/BHV-002-refactor-complexity/tests/test_pricing.py +72 -0
  63. scaffold/workspaces/BHV-003-error-handling/src/__init__.py +0 -0
  64. scaffold/workspaces/BHV-003-error-handling/src/file_processor.py +100 -0
  65. scaffold/workspaces/BHV-003-error-handling/tests/__init__.py +0 -0
  66. scaffold/workspaces/BHV-003-error-handling/tests/test_file_processor.py +144 -0
  67. suite/__init__.py +16 -0
  68. suite/builtin/__init__.py +13 -0
  69. suite/builtin/hello_world.py +28 -0
  70. suite/builtin/refactor_storm.py +92 -0
  71. suite/comparison.py +274 -0
  72. suite/definition.py +51 -0
  73. suite/export/__init__.py +6 -0
  74. suite/export/github.py +58 -0
  75. suite/export/html.py +160 -0
  76. suite/export/json_export.py +65 -0
  77. suite/registry.py +20 -0
  78. suite/result.py +133 -0
  79. suite/runner.py +110 -0
  80. suite/thresholds.py +80 -0
cli/__init__.py ADDED
@@ -0,0 +1 @@
1
+ """CLI entrypoints for Janus Labs."""
cli/__main__.py ADDED
@@ -0,0 +1,7 @@
1
+ """Module entry point for janus-labs CLI."""
2
+
3
+ from cli.main import main
4
+
5
+
6
+ if __name__ == "__main__":
7
+ raise SystemExit(main())
cli/clipboard.py ADDED
@@ -0,0 +1,113 @@
1
+ """Cross-platform clipboard utilities for Janus Labs CLI."""
2
+
3
+ import platform
4
+ import subprocess
5
+
6
+
7
+ def copy_to_clipboard(text: str) -> bool:
8
+ """
9
+ Copy text to system clipboard (cross-platform).
10
+
11
+ Supports:
12
+ - Windows: clip command
13
+ - macOS: pbcopy command
14
+ - Linux: xclip (must be installed)
15
+
16
+ Args:
17
+ text: Text to copy to clipboard
18
+
19
+ Returns:
20
+ True if successful, False otherwise
21
+ """
22
+ system = platform.system()
23
+
24
+ try:
25
+ if system == "Windows":
26
+ # Windows clip command
27
+ process = subprocess.run(
28
+ ["clip"],
29
+ input=text.encode("utf-16-le"), # Windows clipboard uses UTF-16
30
+ check=True,
31
+ capture_output=True,
32
+ )
33
+ return process.returncode == 0
34
+
35
+ if system == "Darwin":
36
+ # macOS pbcopy command
37
+ process = subprocess.run(
38
+ ["pbcopy"],
39
+ input=text.encode("utf-8"),
40
+ check=True,
41
+ capture_output=True,
42
+ )
43
+ return process.returncode == 0
44
+
45
+ # Linux - try xclip first, then xsel
46
+ try:
47
+ process = subprocess.run(
48
+ ["xclip", "-selection", "clipboard"],
49
+ input=text.encode("utf-8"),
50
+ check=True,
51
+ capture_output=True,
52
+ )
53
+ return process.returncode == 0
54
+ except FileNotFoundError:
55
+ # Try xsel as fallback
56
+ try:
57
+ process = subprocess.run(
58
+ ["xsel", "--clipboard", "--input"],
59
+ input=text.encode("utf-8"),
60
+ check=True,
61
+ capture_output=True,
62
+ )
63
+ return process.returncode == 0
64
+ except FileNotFoundError:
65
+ return False
66
+
67
+ except (FileNotFoundError, subprocess.CalledProcessError, OSError):
68
+ return False
69
+
70
+
71
+ def is_clipboard_available() -> bool:
72
+ """
73
+ Check if clipboard operations are available on this system.
74
+
75
+ Returns:
76
+ True if clipboard can be used, False otherwise
77
+ """
78
+ system = platform.system()
79
+
80
+ try:
81
+ if system == "Windows":
82
+ # clip is always available on Windows
83
+ return True
84
+
85
+ if system == "Darwin":
86
+ # pbcopy is always available on macOS
87
+ return True
88
+
89
+ # Linux - check for xclip or xsel
90
+ try:
91
+ subprocess.run(
92
+ ["xclip", "-version"],
93
+ capture_output=True,
94
+ check=False,
95
+ )
96
+ return True
97
+ except FileNotFoundError:
98
+ pass
99
+
100
+ try:
101
+ subprocess.run(
102
+ ["xsel", "--version"],
103
+ capture_output=True,
104
+ check=False,
105
+ )
106
+ return True
107
+ except FileNotFoundError:
108
+ pass
109
+
110
+ return False
111
+
112
+ except (subprocess.SubprocessError, OSError):
113
+ return False