Skip to content

Commit 1ff52ea

Browse files
committed
Milestone 6 - wrap-up
1 parent 04d9cb0 commit 1ff52ea

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

.envrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
watch_file nix/flake.nix
22
watch_file nix/flake.lock
3+
watch_file .venv/pyvenv.cfg
34
use flake ./nix
5+
6+
. .venv/bin/activate

codetracer-python-recorder/src/monitoring/callbacks.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::code_object::{CodeObjectRegistry, CodeObjectWrapper};
77
use crate::ffi;
88
use crate::logging;
99
use crate::policy::{self, OnRecorderError};
10-
use log::{error, warn};
10+
use log::{error, trace, warn};
1111
use pyo3::prelude::*;
1212
use pyo3::types::{PyAny, PyCode, PyModule};
1313
use pyo3::wrap_pyfunction;
@@ -486,7 +486,6 @@ type CallbackFactory = for<'py> fn(&Bound<'py, PyModule>) -> PyResult<CallbackFn
486486
/// Metadata describing how to register a sys.monitoring callback.
487487
pub struct CallbackSpec {
488488
/// Debug label (mirrors the PyO3 function name).
489-
#[allow(dead_code)]
490489
pub name: &'static str,
491490
event: fn(&MonitoringEvents) -> EventId,
492491
factory: CallbackFactory,
@@ -598,6 +597,11 @@ pub fn register_enabled_callbacks<'py>(
598597
) -> PyResult<()> {
599598
for spec in enabled_specs(mask, events) {
600599
let event = spec.event(events);
600+
trace!(
601+
"[monitoring] registering callback `{}` for event id {}",
602+
spec.name,
603+
event.0
604+
);
601605
let cb = spec.make(module)?;
602606
register_callback(py, tool, &event, Some(&cb))?;
603607
}
@@ -613,6 +617,11 @@ pub fn unregister_enabled_callbacks(
613617
) -> PyResult<()> {
614618
for spec in enabled_specs(mask, events) {
615619
let event = spec.event(events);
620+
trace!(
621+
"[monitoring] unregistering callback `{}` for event id {}",
622+
spec.name,
623+
event.0
624+
);
616625
register_callback(py, tool, &event, None)?;
617626
}
618627
Ok(())

design-docs/adr/0011-codetracer-architecture-refactor.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ADR 0011: Codetracer Python Recorder Architecture Refactor
22

3-
- **Status:** Accepted _(incremental rollout in progress — Milestone 4 complete)_
3+
- **Status:** Accepted
44
- **Date:** 2025-02-14
55
- **Deciders:** codetracer recorder maintainers
66
- **Consulted:** DX tooling crew, Runtime tracing stakeholders
@@ -68,5 +68,5 @@ We will modularise the recorder around cohesive responsibilities while preservin
6868
1. Land the modularisation in staged PRs following the implementation plan, keeping behavioural changes isolated per milestone.
6969
2. Maintain compatibility with current Python APIs and crate exports; adjust import paths gradually with deprecation windows if needed.
7070
3. Update architectural documentation and developer guides once core milestones complete.
71-
4. **Status snapshot (2025‑03‑01):** Milestones 1–4 (trace filter, policy/logging, session bootstrap, monitoring plumbing) are complete and validated via `just test`. Runtime tracer modularisation (Milestone 5) and final integration cleanup remain in flight.
72-
5. Confirm behaviour parity after Milestones 5–6, then revisit this ADR for sign-off and capture any follow-up tasks surfaced during the rollout.
71+
4. **Status snapshot (2025‑03‑12):** Milestones 1–6 are complete—the runtime tracer collaborators, monitoring plumbing, and integration cleanups all landed with `just test` (nextest + pytest) coverage, Python benchmark parity, and documentation updates.
72+
5. Confirmed behaviour parity and flipped the ADR to **Accepted**; any follow-up regressions will be handled via normal maintenance triage.

design-docs/codetracer-architecture-refactor-implementation-plan.status.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
- ✅ Milestone 5 Step 6: harmonised the tracer module facade by tightening `IoCoordinator` visibility, pruning unused re-exports, documenting the `runtime::tracer` layout, and updating design docs that referenced the legacy `runtime_tracer.rs` path. `just test` (Rust nextest + Python pytest) verified the cleanup.
8888
- 🔄 Milestone 6 Kickoff: audited crate exports to keep the new module tree internal by default (runtime tracer collaborators + monitoring submodules now `pub(crate)`), and confirmed packaging metadata/docs already reference the updated paths so no additional adjustments are required yet. Pending follow-up: sweep for dead imports and finalise documentation/CI updates before ADR 0011 sign-off.
8989
- ✅ Milestone 6 Step 1: realigned the Python trace filter benchmark to account for the always-prepended `builtin-default` filter when validating metadata, restoring the smoke test with `just test` (nextest + pytest) coverage.
90+
- ✅ Milestone 6 Step 2: finished the integration cleanup—tightened monitoring callback logging to use the new table metadata, confirmed no stale doc references or build script changes were required, and re-ran `just test` (nextest + pytest) as the final verification before ADR 0011 acceptance.
9091

9192

9293
### Planned Extraction Order (Milestone 4)
@@ -117,5 +118,5 @@
117118
5. **Tests:** After each move, update unit tests in `trace_filter` modules and dependent integration tests (`session/bootstrap.rs` tests, `runtime` tests). Targeted command: `just test` (covers Rust + Python suites).
118119

119120
## Next Actions
120-
1. Scope the Milestone 6 integration/cleanup tasks (CI configs, packaging metadata, doc updates) now that the runtime tracer refactor is complete.
121-
2. Track stakeholder feedback and spin out follow-up issues if new risks surface.
121+
1. Communicate completion to stakeholders and monitor for regression reports during adoption.
122+
2. Archive supporting notes and update any external runbooks that referenced the pre-refactor layout.

0 commit comments

Comments
 (0)