cadence_refiner

Cadence Post-Processor – code-level text seasoning for altered states.

When the NCM vector exceeds normal range and a cadence profile fires (barred_out, tweaking, nodding, etc.), this module lightly adjusts Star’s clean LLM output to reinforce cadence effects that LLMs underdo (subtle typos, spacing slips, mild vowel stretch, etc.).

The main LLM already gets the cadence directive + voice sample in its system prompt – that handles semantic stuff (vocabulary, tone, stumbling thoughts). This module adds a thin mechanical layer on top; it is tuned to stay readable and preserve markdown/code structure.

# she breaks her own words, feral style — but the room stays standing

class cadence_refiner.CadencePostProcessor[source]

Bases: object

Pure code text seasoning for supraphysiological cadence states.

No LLM calls. No API costs. No context corruption. Mechanical adjustments stay subtle so structure and markdown survive.

static process(text, cadence_profile)[source]

Apply cadence degradation to clean LLM output.

Parameters:
  • text (str) – Clean text from the main LLM.

  • cadence_profile (Dict[str, Any]) – Dict with keys: state, rules, voice_sample, force, intensity_desc.

Return type:

str