corrections
CI / CI configuration security checks (push) Successful in 6s
CI / Python tests and compilation (push) Failing after 12s
CI / QMD unit tests (push) Skipped
CI / Capabilities and shell quality (push) Successful in 1m50s
CI / Build and inspect generated packages (push) Skipped
CI / Bash integration and installation guards (push) Skipped
CI / Installed client configuration smoke tests (push) Skipped
CI / PowerShell tests on Ubuntu (push) Failing after 7m24s
CI / CI configuration security checks (push) Successful in 6s
CI / Python tests and compilation (push) Failing after 12s
CI / QMD unit tests (push) Skipped
CI / Capabilities and shell quality (push) Successful in 1m50s
CI / Build and inspect generated packages (push) Skipped
CI / Bash integration and installation guards (push) Skipped
CI / Installed client configuration smoke tests (push) Skipped
CI / PowerShell tests on Ubuntu (push) Failing after 7m24s
This commit is contained in:
1 parent
b35e2254b3
commit
c3e22eb902
39 files changed
+246
-151
No files matched your search
@@ -70,6 +70,13 @@ Test-BuildFails 'unknown Claude tool name in capability manifest' {
|
||||
Set-Content $manifest $lines
|
||||
}
|
||||
|
||||
Test-BuildFails 'missing preloaded skill in capability manifest' {
|
||||
param($copy)
|
||||
$manifest = Join-Path $copy 'adapters/claude/capabilities.tsv'
|
||||
$lines = Get-Content $manifest | ForEach-Object { if ($_ -match '^architect\t') { $_ + ',no-such-skill' } else { $_ } }
|
||||
Set-Content $manifest $lines
|
||||
}
|
||||
|
||||
Test-BuildFails 'duplicate plugin name' {
|
||||
param($copy)
|
||||
$manifest = Join-Path $copy 'adapters/plugins.tsv'
|
||||
|
||||
@@ -71,6 +71,11 @@ mutate_invalid_tool_name() {
|
||||
}
|
||||
test_build_fails 'unknown Claude tool name in capability manifest' mutate_invalid_tool_name
|
||||
|
||||
mutate_missing_preloaded_skill() {
|
||||
sed -i 's/^\(architect\t.*\)$/\1,no-such-skill/' "$1/adapters/claude/capabilities.tsv"
|
||||
}
|
||||
test_build_fails 'missing preloaded skill in capability manifest' mutate_missing_preloaded_skill
|
||||
|
||||
mutate_duplicate_plugin() {
|
||||
local manifest="$1/adapters/plugins.tsv"
|
||||
sed -n '2p' "$manifest" >> "$manifest"
|
||||
|
||||
@@ -113,6 +113,26 @@ class HookTests(unittest.TestCase):
|
||||
self.assertBlocked('rm -r build', 'shell')
|
||||
self.assertBlocked('rm -rf build', 'shell')
|
||||
|
||||
def test_allowed_shell_search_gets_the_search_reminder_in_the_same_process(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
home = Path(directory)
|
||||
(home / '.my-ai-configuration/qmd').mkdir(parents=True)
|
||||
(home / '.my-ai-configuration/qmd/qmd-search.mjs').write_text('')
|
||||
env = dict(os.environ, HOME=str(home), USERPROFILE=str(home))
|
||||
|
||||
def run(command, session='s1'):
|
||||
payload = json.dumps({'session_id': session, 'tool_name': 'Bash', 'tool_input': {'command': command}})
|
||||
return subprocess.run([sys.executable, str(SAFETY), '--hook'], input=payload, capture_output=True,
|
||||
encoding='utf-8', timeout=20, env=env)
|
||||
|
||||
result = run('rg Tile')
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertIn('additionalContext', result.stdout)
|
||||
self.assertEqual('', run('git status', 's2').stdout)
|
||||
blocked = run('rm -rf build && rg x', 's3')
|
||||
self.assertEqual(blocked.returncode, 2)
|
||||
self.assertEqual('', blocked.stdout)
|
||||
|
||||
def test_fails_open_on_unusable_input(self):
|
||||
for payload in ('', 'not json', '[]', '{"tool_input": "rm -rf /"}', '{"tool_input": {"command": 5}}'):
|
||||
with self.subTest(payload=payload):
|
||||
|
||||
@@ -365,17 +365,12 @@ class ManagedExtensionTests(unittest.TestCase):
|
||||
with self.assertRaisesRegex(ValueError, 'Another install or update is running'):
|
||||
extensions.acquire_lock(lock)
|
||||
|
||||
def test_selected_adhd_enables_always_on_flag_once(self):
|
||||
def test_selected_adhd_does_not_enable_always_on_flag(self):
|
||||
# plugin-workflow carries the response structure; the full always-on ruleset would duplicate it.
|
||||
config = self.home / '.claude'
|
||||
flag = config / '.i-have-adhd-always'
|
||||
with patch.dict(os.environ, {'CLAUDE_CONFIG_DIR': str(config)}):
|
||||
self.manager(dry_run=True).sync([plugin('i-have-adhd')], ['claude'], {'i-have-adhd'})
|
||||
self.assertFalse(flag.exists())
|
||||
for _ in range(2):
|
||||
self.manager().sync([plugin('i-have-adhd')], ['claude'], {'i-have-adhd'})
|
||||
self.assertTrue(flag.is_file())
|
||||
flag.unlink()
|
||||
self.manager().sync([plugin('Example')], ['claude'], {'Example'})
|
||||
self.manager().sync([plugin('i-have-adhd')], ['claude'], {'i-have-adhd'})
|
||||
self.assertFalse(flag.exists())
|
||||
|
||||
def test_dry_run_summary_has_one_line(self):
|
||||
|
||||
Reference in new issue
Block a user