Architecture
The recursive self-reflexivity layer in PCE is a typed, auditable composition of eight operators. The first six follow the classical pratyabhijñā ordering; the seventh — vimarśa — closes the loop by re-reading the draft against the original prompt; the eighth implements the commit policy multiplexer that v0.4 introduces over v0.3. Every operator has a JSON-serialisable input/output contract, a deterministic seed regime, and an audit log entry per call.
How the operators compose
The diagram below traces a single prompt through the cascade and the closing recognition loop. The shaded backedge marks the BMR-annotated vimarśa → icchā recursion that ADR-003's free-energy budget gates. The same flow is detailed step-by-step in the operator table below.
Operator-by-operator
| Stage | Sanskrit | Role | What it actually does |
|---|---|---|---|
| cit | चित् | Perception / illumination | Generate K candidate continuations from the prompt. K is set by ADR-001 best-of-K with composite scoring; cit_temperature controls prompt-level perturbations rather than sampler temperature. |
| ānanda | आनन्द | Novelty pulse | Score candidates on a novelty axis (lexical / structural distance from the bare-arm reference). Drives K_runtime expansion when the pulse is strong. |
| icchā | इच्छा | Volition · best-of-K | Apply composite scoring (creativity, lexical diversity, idiosyncrasy, emotional resonance, literary devices, imagery) over the K candidates and take the argmax. |
| apohana | अपोहन | Negation / exclusion | Drop candidates that overlap too much with the bare reference or each other; keep only the apoha-distinct ones. |
| jñāna | ज्ञान | Selection | Lock in the chosen candidate and emit a structured ΔF score that the FreeEnergyBudget (ADR-003) can gate against. |
| kriyā | क्रिया | Render | Render the selected candidate to the surface (verbatim or templated) — the draft. |
| vimarśa | विमर्श | Reflexive recognition | Re-read the draft against the prompt and the constraint set; emit a diagnostic dict + an event flag that drives the commit policy. |
| revision | — | Commit policy | Decide whether to commit the draft as-is, the shadow revision, or run the policy multiplexer (always_draft / always_revise / event_gated / learned_gate / oracle). |
The commit-policy multiplexer (v0.4)
v0.3 had a single commit policy: vimarśa fires an event, the revision is committed if and only if the event flag is set (event_gated). v0.4 ships five policies — always_draft, always_revise, event_gated (the v0.3 policy), learned_gate (ADR-002), and an analysis-only oracle upper bound. H8c reports the leaderboard against a bare control; H8b reports the gate calibration. The results page shows the per-policy bars.
Substrate boundary
Everything above the operator boundary is portable: the cascade runs unchanged inside Cursor, Claude Code, or a bare shell. Below the boundary lives the substrate adapter (src/pce/substrate/haiku_lm.py), which speaks claude --print over the OAuth-bound CLI. The plugin page documents the three install paths and the model-override knobs.
What "computation" looks like in this cascade
Read in active-inference terms (see the background page for the variational identities), every operator is one bookkeeping step inside the same free-energy minimisation. cit seeds the candidate posterior q(z) over K continuations, sampled from the prompt-conditioned generative model. ānanda attaches a novelty signal that biases q(z) away from the bare-arm reference, lowering the KL divergence between q(z) and a posterior that prefers surface-divergent candidates. icchā performs the best-of-K reduction with composite scoring, which is the discrete approximation to a KL-minimising step over the candidate set. apohana is the cascade's Bayesian Model Reduction stage: it drops candidates whose evidence ratio against the surviving set falls below the apoha threshold.
jñāna commits the selection and emits a structured ΔF score that the ADR-003 free-energy budget reads. kriyā renders the surface verbatim — F is unchanged at this step, only the representation changes. vimarśa is the second-pass operator that reads the draft against the prompt and the constraint set; whether it fires another revision pass depends on whether the marginal F-reduction in the previous pass crossed ADR-003's threshold. The commit-policy multiplexer below is the final F-comparison: it decides between the draft, the shadow revision, and (in the analysis-only oracle policy) the judge-pair maximum, picking the surface with the lowest residual F under the selected policy. Empirically, the H8a revision-vs-draft contrast and the H8b learned-gate improvement are both evidence that the cascade is moving in the F-minimising direction; the results page shows the per-mechanism numbers.
What is wired but not exercised
The Hopfield ālayavijñāna (long-term store) operators ship in the v0.4 codebase but were not exercised in the Phase 7 pilot — their multi-session dynamics require a longitudinal study that v0.4 does not run. The chandas-aware scorer for Sanskrit prosody is on the v0.5 ladder. Both are noted honestly in the paper's §10 and on the discussion page.