Record one clustering-pass snapshot to the live tracker (C3)
Source:R/live_tracking.R
live_record_clustering_pass.RdWrites outputs/<run>/live/clustering_pass_<N>.json with the AI's
partition proposal for pass N: the input leaves, the proposed cluster
assignments, and the AI's rationale per cluster + overall. Called from
generate_themes_multipass() in R/theme_algorithm_v2.R after
every clustering call.
Arguments
- tracker
A
LiveTrackeror NULL.- pass_n
Integer; the pass number (1-based).
- leaves
The list of leaves shown to the AI at this pass (each leaf record carries
leaf_id,leaf_type, andmember_code_keys).- proposal
The AI's proposal record returned by
ai_propose_clustering():verdict,cluster_assignments,overall_rationale.- codes
Optional list of code records (the original codebook extraction); used to enrich the snapshot with code names per leaf.
Details
Honors C-tenet 3 (live tracking artifacts during processing): a
researcher can cat outputs/<run>/live/clustering_pass_2.json
mid-run and see exactly what pass 2 did.
Atomic rewrite (write-temp + rename) so a researcher cat-ing the
file always sees a coherent snapshot. Safe to call with
tracker = NULL (no-op).