Skip to content

Commit a7e8787

Browse files
committed
Stage 5
1 parent 71c3809 commit a7e8787

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

design-docs/function-level-srp-refactor-plan.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ These functions currently exceed 60–120 lines and interleave control flow with
2222
3. **Add regression tests around extracted helpers** so that future changes to callbacks can lean on focused coverage instead of broad integration tests.
2323
4. **Maintain behavioural parity** by running full `just test` plus targeted fixture comparisons after each stage.
2424

25+
### Helper Module Map
26+
- `runtime::frame_inspector` owns frame discovery and locals/globals snapshots through the `FrameSnapshot` abstraction.
27+
- `runtime::value_capture` centralises argument, scope, and return-value recording, keeping encoding concerns outside the tracer façade.
28+
- `runtime::logging` provides the `log_event` helper so callback logging stays consistent and format-agnostic.
29+
- `session::bootstrap` deals with filesystem setup, format resolution, and program metadata collection for the Rust entrypoint.
30+
- Python `session.py` mirrors the responsibilities with `_coerce_format`, `_validate_trace_path`, and `_normalize_activation_path` helpers.
31+
2532
## Work Breakdown
2633

2734
### Stage 0 – Baseline & Guardrails (1 PR)
@@ -87,4 +94,3 @@ These functions currently exceed 60–120 lines and interleave control flow with
8794
- **Unsafe code mistakes:** Wrap raw pointer usage in RAII helpers with debug assertions; add fuzz/ stress tests for recursion-heavy scripts.
8895
- **Performance regressions:** Benchmark tracer overhead before and after major stages; inline trivial helpers where necessary, or mark with `#[inline]` as appropriate.
8996
- **Merge conflicts:** Finish each stage quickly and rebase branches frequently; keep PRs focused (≤400 LOC diff) to ease review.
90-

design-docs/function-level-srp-refactor-plan.status.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
- ✅ Exposed `record_return_value` in `runtime::value_capture` and refactored `RuntimeTracer::on_py_return` to orchestrate activation checks, logging, and value recording.
2323
- ✅ Extended runtime tests with explicit return capture coverage and activation deactivation assertions.
2424

25+
## Stage 5 – Cleanup & Regression Sweep
26+
- ✅ Audited runtime modules for obsolete inline comments or TODOs introduced pre-refactor; none remained after helper extraction.
27+
- ✅ Documented the helper module map in `design-docs/function-level-srp-refactor-plan.md` for contributor onboarding.
28+
- ✅ Re-ran `just test` (Rust `cargo nextest` + Python `pytest`) to confirm post-cleanup parity.
29+
2530
## Next Actions
2631
- Draft short notes on activation gating and frame search mechanics to complete Stage 0.
27-
- Begin Stage 5 cleanup/regression sweep once Stage 0 notes are captured.
32+
- Track Stage 5 fixture comparisons if we decide to snapshot JSON/Binary outputs post-refactor.

trace.json/trace_metadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"workdir":"/home/tzanko/code/repos/refactor-vc","program":"/home/tzanko/code/repos/refactor-vc/examples/value_capture_all.py","args":[]}

trace.json/trace_paths.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["/home/tzanko/code/repos/refactor-vc/examples/value_capture_all.py"]

0 commit comments

Comments
 (0)