fix(kvb-check-score): import sibling modules under python -I
score.py and backfill.py ran with python -I drop their own directory from sys.path, so the sibling imports failed (Security 2.0 hit it 2026-11-14 02:40). Both now put their resolved script directory first; tests run both scripts isolated. 🎯 Fix: 95 % 💥 Break: 2 % 💸 Tokens: 100 % ⏱️ Velocity: 100 % 🛡️ Security: 100 % 🏆 Score: 93 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
246716ece0
commit
5544f83679
4 files changed
+18
No files matched your search
@@ -35,6 +35,15 @@ class TestScore(unittest.TestCase):
|
||||
self.assertEqual(result.stderr, "")
|
||||
return result.stdout.splitlines(), result.returncode
|
||||
|
||||
def test_runs_under_python_isolated_mode_from_another_directory(self):
|
||||
with tempfile.TemporaryDirectory() as elsewhere:
|
||||
result = subprocess.run(
|
||||
[sys.executable, "-I", str(SCORE), *flags(BASE), "--message-block"],
|
||||
cwd=elsewhere, env=ENV, capture_output=True, text=True, check=False,
|
||||
)
|
||||
self.assertEqual((result.returncode, result.stderr), (0, ""))
|
||||
self.assertIn("🎯 Fix: 95 %", result.stdout)
|
||||
|
||||
def test_formula_and_line_format(self):
|
||||
self.assertEqual(
|
||||
self._score(fix="95", **{"break": "4"}),
|
||||
|
||||
Reference in new issue
Block a user