feat: initial commit

This commit is contained in:
2026-08-29 13:17:59 +02:00
commit 142f5f5759
91 changed files with 6155 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
"""Ślad audytowy jest artefaktem CI - nie może wynosić sekretów."""
from agentic_codemod.observability.audit import redact
def test_redakcja_tokenow():
assert "glpat-" not in redact("token: glpat-ABCDEFGHIJKLMNOP")
assert "supersecret" not in redact('api_key="supersecret123"')
assert "***REDACTED***" in redact("Authorization: Bearer abcdefghijklmnop")
def test_redakcja_nie_niszczy_zwyklego_tekstu():
text = "Zmieniono plik src/acme_app/notifier.py, 9 podmian."
assert redact(text) == text
def test_log_zapisuje_wpisy_do_pliku(audit):
audit.record("read_file", {"path": "a.py"}, detail="ok")
audit.event("intake", package="acme-sdk")
assert (audit.run_dir / "trace.jsonl").read_text(encoding="utf-8").count("\n") == 2
assert audit.tool_call_count == 1