Skip to contents

The v2 theme algorithm. Multi-pass partitioning: at each pass the AI sees the current leaves (codes initially, then prior-pass clusters) and either proposes a partition into clusters OR declares convergence. The penultimate stable structure becomes subthemes; the final stable structure becomes themes. A dedicated post-convergence labeling pass assigns researcher-facing names + descriptions to every theme and subtheme with the full tree visible.

Usage

generate_themes_multipass(
  coding_state,
  provider,
  config = list(),
  learning_context = NULL,
  research_focus = "",
  concepts = NULL,
  audit_log = NULL,
  response_cache = NULL,
  live_tracker = NULL,
  methodology_override = NULL
)

Arguments

coding_state

ProgressiveCodingState

provider

AIProvider

config

Theme config section (only algorithm + quotes_per_theme are consulted; the v2 path has NO threshold knobs per C1).

learning_context

Optional LearningContext; if present, its for_theming text is added to the clustering prompts as reference context. Used by the manuscript-learning path.

research_focus

Character; the study's research focus statement.

concepts

Optional character vector of core research concepts.

audit_log

Optional AuditLog.

response_cache

Optional ResponseCache.

live_tracker

Optional LiveTracker (per C3).

methodology_override

Optional character; per-call methodology rules override. Used by the Mode 3 inductive emergent-themes pass.

Value

ThemeSet S3 with merge_history attached.

Details

Called by generate_themes_iterative() when config$analysis$themes$algorithm == "v2" (the default).