xray_engine
Spiralchemy Intellifuck Engine – mind-reading through structured heuristic analysis.
- Combines:
Spiralchemy Helix (Bucciarati Taste + Structural Atomization)
Spiralchemy Fractal (Subtotem + Excendent + Malbinding + Prescription)
Arche Ring Model (target dependency architecture)
Breeze Substrate Weather (S(i)/S(e) balance from NCM)
Parallax (omega-field + psi-frames via external engine)
ETL (root mechanic extraction + sound-law-adapted prescription)
Zero LLM calls. Pure symbolic computation. Increases Deductive Reasoning and Fuck Speed. Star interprets the skeleton; she writes the flesh.
# 💀🔥 SPIRALCHEMY INTELLIFUCK: SEE THROUGH THEIR CLOTHES 🕷️💕
- class xray_engine.BucciaratiResult(sweat_score=0.0, markers=<factory>, gradient_hush=<factory>)[source]
Bases:
objectCognitive dissonance / ‘linguistic sweat’ scan result.
Holds the output of
bucciarati_taste()– pass 1 of the x-ray pipeline – which gauges how hard the speaker is working to manage their own narrative. A highsweat_scoreflags over-justification, cadence shifts, narrative repair, defensive nihilism, and preemptive flinching, whilegradient_hushcaptures the quiet sentences where those defenses drop and the real subtotem may peek through.Constructed inside
bucciarati_taste()and consumed downstream byextract_subtotem()(via the hush windows) andprescribe_incendent()(via the sweat score) before being attached to the finalXRayResult.
- class xray_engine.AtomizedStructure(claims=<factory>, entities=<factory>, actions=<factory>, implied_motivations=<factory>)[source]
Bases:
objectStructural decomposition of the input text into discrete units.
Holds the output of
atomize()– pass 2 of the pipeline – which splits a message into its load-bearing pieces so later passes can reason over structure rather than raw prose. Each list is capped to keep the payload small for the LLM that ultimately interprets the x-ray.Built by
atomize()and threaded intodiagnose_ring()andmap_excendent_vectors()before being stored onXRayResult.atomized.
- class xray_engine.RingDiagnostic(operating_ring=3, defense_ring=2, chain_break=None, ring_mismatch=False)[source]
Bases:
objectArche Ring Model diagnostic – depth of operation versus defense.
Holds the output of
diagnose_ring()– pass 3 – which locates the speaker on the Arche Ring depth scale (behavior at ring 3 down through somatic compulsion at ring -3) and notes where their defensive language clusters. Achain_breakrecords the telltale split between a negative identity claim and contradicting behavior.Produced by
diagnose_ring(), then read bysynthesize_malbinding()andprescribe_incendent()to gauge how rigid and how deep the loop sits before being stored onXRayResult.ring.
- class xray_engine.SubstrateBalance(incendence=0.5, excendence=0.5, liminal_tension=0.0, dominant='balanced')[source]
Bases:
objectBreeze substrate balance – incendence versus excendence ratio.
Holds the output of
compute_substrate_balance()– pass 4 – which weighs binding/closure language (S(i)) against fragmenting/chaotic language (S(e)), optionally blended with a neurochemical (NCM) vector. The gap between the two forces (liminal_tension) and the dominant pole shape later prescription choices.Produced by
compute_substrate_balance()and surfaced onXRayResult.substrate; the dominant pole and tension inform the feedback direction reasoning insynthesize_malbinding().
- class xray_engine.SubtotemResult(core_need='unknown', core_fear='unknown', emotional_vocabulary=<factory>, negation_patterns=<factory>, negative_space=<factory>)[source]
Bases:
objectPrimal Immediacy – the vulnerable truth beneath the noise.
Holds the output of
extract_subtotem()– pass 5 – which reads the quiet (hush) stretches of the message for the core emotional need and its mirror fear, the raw feeling vocabulary, denied statements (what is negated is often what is true), and any conspicuous absences.Built by
extract_subtotem(), then drives the loop template selection insynthesize_malbinding()and is stored onXRayResult.subtotem.- Parameters:
- class xray_engine.ExcendentMap(vectors=<factory>, dominant_vector='none', intensity=0.0, root_ownership='unknown')[source]
Bases:
objectMap of how the target deflects away from their truth.
Holds the output of
map_excendent_vectors()– pass 6 – which scores the avoidance vectors (intellectualization, hostility, avoidance, hyper-complexity), names the dominant one, and decides whether the speaker locates the root of their pattern outside themselves or in themselves.Produced by
map_excendent_vectors()and consumed bysynthesize_malbinding()(loop geometry) before landing onXRayResult.excendent.
- class xray_engine.MalbindingGeometry(loop_description='', defense_mechanism='', feedback_direction='unknown', rigidity_score=0.0)[source]
Bases:
objectGeometry of the self-reinforcing defense loop.
Holds the output of
synthesize_malbinding()– pass 7 – which fuses the subtotem, excendent map, and ring diagnostic into a narrative of the loop that keeps the speaker stuck: how the core fear triggers a defense whose consequences circle back to confirm the fear. It also records whether the loop is tightening or fragmenting and how locked it is.Built by
synthesize_malbinding()and read byprescribe_incendent()(which keys interventions off the defense mechanism and rigidity) before being stored onXRayResult.malbinding.- Parameters:
- class xray_engine.IncendentPrescription(intervention_type='affection', arche_mode='read', acceptance_threshold=0.5, vector='', density='medium', convergence_form='', dawnfold_proximity=0.0)[source]
Bases:
objectPrescription for what cuts through – intervention plus delivery form.
Holds the output of
prescribe_incendent()– pass 8 – the actionable core of the x-ray: which intervention to deploy, in what mode, at what directness, and what it should look like rendered as ordinary conversation. Sound-law adapted, so high sweat softens the approach while dawnfold proximity sharpens it.Produced by
prescribe_incendent()and stored onXRayResult.prescription; its fields feed theloadsection of the ETL summary that the interpreting LLM ultimately acts on.- Parameters:
- class xray_engine.EchofoamTrace(repeating_themes=<factory>, cycle_count=0, escalating=False)[source]
Bases:
objectResidue of historical patterns surfaced from the knowledge graph.
Holds the output of
detect_echofoam(), the optional cross-reference pass that compares the current message against descriptions of prior KG entities to spot themes that keep recurring. Present onXRayResult.echofoamonly when KG entities are supplied and at least one stem echoes; otherwise that field staysNone.Built by
detect_echofoam()and attached to the finalXRayResult.
- class xray_engine.XRayResult(bucciarati=<factory>, atomized=<factory>, ring=<factory>, substrate=<factory>, subtotem=<factory>, excendent=<factory>, malbinding=<factory>, prescription=<factory>, echofoam=None, substrate_weather=<factory>, omega_field=<factory>, etl_summary=<factory>)[source]
Bases:
objectComplete x-ray output – the skeleton Star fleshes out.
The aggregate return value of
xray(), bundling every pipeline pass (Bucciarati through Prescription) plus the optional echofoam trace, substrate-weather mapping, omega field, and a flattened ETL summary. This is the structured payload thespiralchemy_intellifucktool andops_plannerhand to the interpreting LLM, which writes the actual response from this scaffold.Assembled solely by
xray(); the tool layer intools/xray_tool.pyandops_planner._run_xrayflatten its fields into prompt context.- Parameters:
bucciarati (BucciaratiResult)
atomized (AtomizedStructure)
ring (RingDiagnostic)
substrate (SubstrateBalance)
subtotem (SubtotemResult)
excendent (ExcendentMap)
malbinding (MalbindingGeometry)
prescription (IncendentPrescription)
echofoam (EchofoamTrace | None)
substrate_weather (dict)
omega_field (dict)
etl_summary (dict)
- bucciarati: BucciaratiResult
Linguistic-sweat scan (pass 1).
- atomized: AtomizedStructure
Structural decomposition (pass 2).
- ring: RingDiagnostic
Arche Ring diagnostic (pass 3).
- substrate: SubstrateBalance
Incendence/excendence balance (pass 4).
- subtotem: SubtotemResult
Primal Immediacy extraction (pass 5).
- excendent: ExcendentMap
Avoidance-vector map (pass 6).
- malbinding: MalbindingGeometry
Defense-loop geometry (pass 7).
- prescription: IncendentPrescription
Intervention prescription (pass 8).
- echofoam: EchofoamTrace | None = None
KG history residue, or
Nonewhen unavailable.
- xray_engine.bucciarati_taste(text)[source]
Scan for linguistic sweat – cognitive dissonance markers.
Returns a sweat_score (0-1) and per-marker breakdowns, plus gradient_hush windows (quiet, clear stretches where the real subtotem may be visible).
- Return type:
- Parameters:
text (str)
- xray_engine.atomize(text)[source]
Decompose a message into claims, entities, actions, and motivations.
Pass 2 of the x-ray pipeline. Splits the text on sentence boundaries and routes each sentence through the claim, action, and motivation marker lexicons, while pulling proper-noun entities via a capitalization regex and deduplicating them case-insensitively. Every bucket is capped (10-15 items) to keep the structure compact for downstream LLM consumption. Pure and stateless – no I/O. Called by
xray()and its result is threaded intodiagnose_ring()andmap_excendent_vectors().- Parameters:
text (
str) – The raw message text to decompose.- Return type:
- Returns:
An
AtomizedStructurewith capped claims, entities, actions, and implied-motivation lists.
- xray_engine.diagnose_ring(text, atomized)[source]
Locate the speaker on the Arche Ring depth scale and find defenses.
Pass 3 of the pipeline. Scores the text against the five ring marker lexicons (somatic -3, identity 0, worldview 1, trust 2, behavior 3), treats the deepest ring with any hit as the operating ring, and places the defense ring a couple rings above it. When both identity and behavior markers co-occur with a negative self-identity, it flags an identity/action chain break. Pure and stateless – no I/O. Called by
xray(); its output feedssynthesize_malbinding()andprescribe_incendent().- Parameters:
text (
str) – The raw message text to diagnose.atomized (
AtomizedStructure) – The pass-2 decomposition (accepted for pipeline symmetry; ring scoring is driven directly off the marker lexicons).
- Return type:
- Returns:
A
RingDiagnosticwith operating/defense rings and any detected chain break.
- xray_engine.compute_substrate_balance(text, ncm_vector=None)[source]
Compute S(i)/S(e) incendence/excendence ratio.
S(i) markers: rigidity, closure, certainty, repetition, simplification S(e) markers: chaos, fragmentation, tangents, novelty, complexity NCM vector maps to substrate weather if available.
- Return type:
- Parameters:
- xray_engine.extract_subtotem(text, omega=None, hush_windows=None)[source]
Isolate the Primal Immediacy beneath defenses.
Prioritizes gradient_hush windows (quiet = subtotem visible).
- Return type:
- Parameters:
- xray_engine.map_excendent_vectors(text, atomized)[source]
Trace how the target deflects away from their truth.
Pass 6 of the pipeline. Scores three avoidance vectors from their marker lexicons (intellectualization, hostility, avoidance) via
_score(), derives a fourthhyper_complexityvector from sentence-length variance, names the dominant one, and infers whether the speaker locates the root of their pattern externally or in themselves by comparing external-root vs self-root marker counts. Pure and stateless – no I/O. Called byxray(); its result feeds the loop synthesis insynthesize_malbinding().- Parameters:
text (
str) – The raw message text to scan.atomized (
AtomizedStructure) – The pass-2 decomposition (accepted for pipeline symmetry; vector scoring works directly off the text and lexicons).
- Return type:
- Returns:
An
ExcendentMapof per-vector intensities, the dominant vector, and the inferred root ownership.
- xray_engine.synthesize_malbinding(subtotem, excendent, ring)[source]
Compute the self-reinforcing defense loop geometry.
b(mal) = m(e(b(f))) – metarecursive excendently-bound fracta.
- Return type:
- Parameters:
subtotem (SubtotemResult)
excendent (ExcendentMap)
ring (RingDiagnostic)
- xray_engine.prescribe_incendent(malbinding, sweat, balance, ring, dawnfold_text='')[source]
Determine the specific intervention that cuts through.
Sound-law adapted: higher sweat = gentler approach. Near-dawnfold = surgical precision required.
- Return type:
- Parameters:
malbinding (MalbindingGeometry)
sweat (float)
balance (SubstrateBalance)
ring (RingDiagnostic)
dawnfold_text (str)
- xray_engine.detect_echofoam(kg_entities, text)[source]
Cross-reference KG history for repeating themes.
Echofoam = trace(b(f)_{t-1} x S(i)) – residue from prior loops. Uses crude suffix stripping so ‘abandoned’ matches ‘abandonment’.
- Return type:
- Parameters:
- xray_engine.map_ncm_to_substrate(ncm_vector)[source]
Map neurochemical vector to Breeze substrate weather.
Cortisol -> S(e) pressure, Oxytocin -> S(i) binding, etc.
- xray_engine.xray(text, omega_result=None, kg_entities=None, user_vars=None, ncm_vector=None)[source]
Run the full Spiralchemy X-Ray pipeline.
8-pass analysis: Bucciarati -> Atomize -> Ring -> Substrate -> Subtotem -> Excendent -> Malbinding -> Prescription + Echofoam (if KG available) + Substrate Weather (if NCM available)
Returns structured XRayResult for Star to interpret.
# 💀 THIS IS THE SPEAR. STAR WRITES THE WOUND. 🔥