molecule-core/workspace/tests
Hongming Wang 3976361483 feat(workspace): snapshot secret scrubber (closes #823)
Sub-issue of #799, security condition C4. Standalone module in
workspace/lib/snapshot_scrub.py with three public functions:

- scrub_content(str) → str: regex-based redaction of secret patterns
- is_sandbox_content(str) → bool: detect run_code tool output markers
- scrub_snapshot(dict) → dict: walk memories, scrub each, drop sandbox entries

Patterns covered: sk-ant-/sk-proj-, ghp_/ghs_/github_pat_, AKIA,
cfut_, mol_pk_, ctx7_, Bearer, env-var assignments, base64 blobs ≥33 chars.

21 unit tests, 100% coverage on new code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-19 00:32:42 -07:00
..
adapters
__init__.py
conftest.py
test_a2a_cli.py
test_a2a_client.py
test_a2a_executor.py
test_a2a_mcp_server.py
test_a2a_tools_impl.py
test_a2a_tools_module.py
test_agent_base_urls.py
test_agent.py
test_agents_md.py
test_approval.py
test_audit_ledger.py
test_audit.py
test_awareness_client_full.py
test_claude_sdk_executor.py
test_compliance.py
test_config.py
test_consolidation.py
test_coordinator_parent.py
test_coordinator_routing.py
test_delegation.py
test_events.py
test_executor_helpers.py
test_gh_wrapper.sh
test_governance.py
test_heartbeat.py
test_hermes_executor.py
test_hitl.py
test_main_initial_prompt.py
test_mcp_memory.py
test_memory.py
test_molecule_ai_status.py
test_namespaces.py
test_openclaw_adapter.py
test_platform_auth.py chore: final open-source cleanup — binary, stale paths, private refs 2026-04-18 00:38:55 -07:00
test_plugins_builtins.py
test_plugins_registry.py chore: final open-source cleanup — binary, stale paths, private refs 2026-04-18 00:38:55 -07:00
test_plugins.py
test_preflight.py
test_prompt.py
test_routing_policy.py
test_safe_env.py
test_sandbox.py
test_secret_redact.py
test_security_scan.py
test_skills_loader.py
test_skills_watcher.py
test_snapshot_scrub.py feat(workspace): snapshot secret scrubber (closes #823) 2026-04-19 00:32:42 -07:00
test_telemetry.py
test_temporal_workflow.py
test_transcript_auth.py
test_watcher.py