molecule-ai-workspace-runtime/tests
rabbitblood f1bede31a8 feat(precommit): add secret scan to bundled pre-commit hook (defense-in-depth for #2090-style leaks)
Adds a secret-scan gate alongside the existing internal-paths block in
the runtime's bundled pre-commit hook. Runs on every commit in every
repo (not scoped to Molecule-AI public repos like the internal-paths
block) — refuses any staged addition matching a high-value credential
shape and prints a recovery message that does NOT echo the secret value.

Pattern set covers GitHub family (ghp_, ghs_, gho_, ghu_, ghr_,
github_pat_), Anthropic / OpenAI / Slack / AWS — same shape as the
tenant-proxy CI scanner; keep aligned when either side adds a pattern.

Single hook file dispatches both checks (renamed
pre-commit-block-internal-paths.sh → pre-commit-checks.sh) so each
agent commit pays one git-config + one hook-install surface, not two.
Both checks share the existing fast-paths (skip if GIT_AUTHOR_NAME
unset; skip during rebase / cherry-pick / merge / revert).

End-to-end test exercises a real bash subprocess against a real temp
git repo with real staged content. Three cases:
 - ghs_-prefixed token in package.json (the actual #2090 vector) → refuse
 - clean README → pass through
 - sk-ant- key in a non-Molecule-AI repo → refuse (secret scan is universal,
   internal-paths block is not)

Skipped when bash is not on PATH so Windows test environments without
WSL stay green.

Bumps version 0.1.15 → 0.1.16.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 11:57:39 -07:00
..
conftest.py feat: migrate a2a-sdk 1.x (KI-009) (#39) 2026-04-24 01:54:33 +00:00
test_a2a_error_observability.py fix(tests): remove pytest-asyncio dependency from #51 regression tests 2026-04-24 11:34:30 -07:00
test_a2a_mcp_server.py fix(builtin_tools/audit): fail-secure RBAC — read-only default when config unavailable 2026-04-20 22:47:38 +00:00
test_adapter_loader.py fix(adapter-loader): fall back to any BaseAdapter subclass 2026-04-20 16:59:12 -07:00
test_audit.py fix(builtin_tools/audit): fail-secure RBAC — read-only default when config unavailable 2026-04-20 22:47:38 +00:00
test_executor_helpers.py fix(runtime): capture stderr in A2A error response (closes #66) 2026-04-24 05:00:51 +00:00
test_imports.py fix: switch top-level from adapters import to absolute imports (#1) 2026-04-16 07:53:03 -07:00
test_llm_auth.py fix(llm_auth): tighten base-URL hostname match + strip whitespace + no token in logs 2026-04-23 10:46:07 -07:00
test_plugins_builtins_env_scrub.py fix(plugins_registry/builtins): strip API keys from plugin setup.sh env 2026-04-20 22:52:13 +00:00
test_precommit_hook.py feat(precommit): add secret scan to bundled pre-commit hook (defense-in-depth for #2090-style leaks) 2026-04-26 11:57:39 -07:00
test_session_resume_gate.py test: move sdk stubs to conftest.py (consistent across all test modules) 2026-04-16 11:15:45 -07:00
test_shared_runtime.py fix(shared_runtime): push heartbeat on CLEAR in set_current_task() (#37) 2026-04-22 17:33:42 +00:00
test_token_refresh_1877.py test(1877): convert async tests to sync httpx.Client to unblock CI 2026-04-23 13:35:45 -07:00
test_validation.py test+fix(builtin_tools/validation): add test coverage + fix ".." bypass in regex 2026-04-21 00:55:08 +00:00
test_workspace_id_validation.py fix(a2a_cli): validate WORKSPACE_ID in discover() before X-Workspace-ID header 2026-04-21 01:35:37 +00:00