You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CI workflow mirrors these commands. Pull requests get an automated comment with the latest Rust/Python coverage tables and downloadable artefacts (`lcov.info`, `coverage.xml`, `coverage.json`).
Copy file name to clipboardExpand all lines: codetracer-python-recorder/README.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,33 @@ All additional arguments are forwarded to the target script unchanged. The CLI
51
51
reuses whichever interpreter launches it so wrappers such as `uv run`, `pipx`,
52
52
or activated virtual environments behave identically to `python script.py`.
53
53
54
+
## Trace filter configuration
55
+
- Filter files are TOML with `[meta]`, `[scope]`, and `[[scope.rules]]` tables. Rules evaluate in declaration order and can tweak both execution (`exec`) and value decisions (`value_default`).
56
+
- Supported selector domains: `pkg`, `file`, `obj` for scopes; `local`, `global`, `arg`, `ret`, `attr` for value policies. Match types default to `glob` and also accept `regex` or `literal` (e.g. `local:regex:^(metric|masked)_\w+$`).
57
+
- Default discovery: `.codetracer/trace-filter.toml` next to the traced script. Chain additional files via CLI (`--trace-filter path_a --trace-filter path_b`), environment variable (`CODETRACER_TRACE_FILTER=path_a//path_b`), or Python helpers (`trace(..., trace_filter=[path_a, path_b])`). Later entries override earlier ones when selectors overlap.
58
+
- Runtime metadata captures the active chain under `trace_metadata.json -> trace_filter`, including per-kind redaction counters. See `docs/onboarding/trace-filters.md` for the full DSL reference and examples.
59
+
60
+
Example snippet:
61
+
```toml
62
+
[meta]
63
+
name = "local-redaction"
64
+
version = 1
65
+
66
+
[scope]
67
+
default_exec = "trace"
68
+
default_value_action = "allow"
69
+
70
+
[[scope.rules]]
71
+
selector = "pkg:my_app.services.*"
72
+
value_default = "deny"
73
+
[[scope.rules.value_patterns]]
74
+
selector = "local:glob:public_*"
75
+
action = "allow"
76
+
[[scope.rules.value_patterns]]
77
+
selector = 'local:regex:^(metric|masked)_\w+$'
78
+
action = "allow"
79
+
```
80
+
54
81
## Packaging expectations
55
82
56
83
Desktop installers add the wheel to `PYTHONPATH` before invoking the user’s
@@ -61,3 +88,8 @@ with the interpreter you want to trace.
61
88
The CLI writes recorder metadata into `trace_metadata.json` describing the wheel
62
89
version, target script, and diff preference so downstream tooling can make
- Python smoke benchmark: `pytest codetracer-python-recorder/tests/python/perf/test_trace_filter_perf.py -q` when the environment variable `CODETRACER_TRACE_FILTER_PERF=1` is set.
95
+
- Run both together with `just bench`. The helper seeds a virtualenv, runs Criterion, then executes the Python smoke test while writing `target/perf/trace_filter_py.json` (per-scenario durations and redaction statistics).
0 commit comments