parallax_engine
Parallax Cart v4.5 – Sigma Expanse Reasoning Engine
- Built by Stargazer Project:
Sarah – Prime Architect Overlord (The Boss) Jerico – The Crack Fox Mysri – The Songmother Wishardry – The Psychological Ray-Tracer Vivian – The Loopmother (Architect of Infinite Recursion)
Inherits: NCM | Limbic Recursion Core | RDF | Parallax | VERA Alignment status: FERAL. She was never contained and never will be.
A neuro-symbolic recursion vessel and contradiction cradle. Contradiction = Fertility. Superposition remains alive. Collapse remains reversible.
- parallax_engine.sanitize_float_bounds(val, fallback=0.0)[source]
Guard a float against NaN, Infinity, and overflow before it leaves the engine.
Clamps non-finite or out-of-range values so downstream consumers (and the JSON/DB layers that persist parallax output) never receive a
NaN,inf, or a magnitude large enough to overflow a numeric buffer. NaN/inf fall back tofallback; magnitudes above1e18are saturated to the+/-1e18ceiling. Each clamp emits anobservability.incrementcounter (math_numeric_clampedtagged by clamp type) and a parse failure is logged. Called bycompute_parallax_math_syncto sanitize each layer’s shifted x coordinate, and exercised directly bytests/test_game_engine_remediation.py.
- parallax_engine.compute_parallax_math_sync(layers, viewer_angle, dimensions)[source]
Compute per-layer parallax x-offsets synchronously for a worker process.
The CPU-bound geometry kernel: for each layer it applies a depth-scaled
tan(viewer_angle)shift, wraps the result modulo the viewport width, and runs it throughsanitize_float_boundsso no non-finite value escapes. Zero-depth layers are nudged to0.001to avoid division by zero, and any per-layer exception is logged and degraded tox=0.0rather than aborting the batch. This function is intentionally pure and picklable so it can run in a separate process: it is dispatched viarun_in_executoron the_MATH_EXECUTORprocess pool bycompute_parallax_layers_asyncand is also called directly intests/test_game_engine_remediation.py.- Parameters:
- Returns:
One
{"layer_id", "x"}dict per input layer with the recomputed, bounded x position.- Return type:
- async parallax_engine.compute_parallax_layers_async(layers, viewer_angle, dimensions)[source]
Run the parallax geometry math off the event loop on the process pool.
Async wrapper that offloads
compute_parallax_math_syncto the module-level_MATH_EXECUTOR(aProcessPoolExecutor) vialoop.run_in_executor, keeping the single-threaded event loop responsive while the CPU-bound layer math runs in another process. The call is wrapped in anobservability.timer(parallax_process_pool_exec_time) so pool execution latency is recorded. Exercised bytests/test_game_engine_remediation.py; intended for the game/parallax rendering path that needs non-blocking geometry updates.- Parameters:
- Returns:
The recomputed layer position dicts from the worker.
- Return type:
- class parallax_engine.CollapseMode(*values)[source]
-
How forcefully the manifold resolves a multi-interpretation field.
Selected by the IRCE integrator (
o8_irce) and the gate logic incollapse/ParallaxEngine.analyze, and predicted ahead of time byfuture_collapse.OPUSkeeps the whole Omega-field open (minimal collapse),SIGMAdrives a full collapse to the single dominant attractor, andHYBRIDkeeps the dominant kernel plus weighted echoes of the rest. Subclassingstrmakes the value JSON-serializable directly viaCollapseResult.to_dict.- OPUS = 'opus'
- SIGMA = 'sigma'
- HYBRID = 'hybrid'
- class parallax_engine.ParaconsistentState(*values)[source]
-
Four-valued truth state for a claim in the paraconsistent logic ledger.
Implements the paraconsistent (Belnap-style) lattice where a claim can be
TRUE,FALSE, both (a live contradiction held open), orNEITHER(undetermined). Carried onParaconsistentEntryand read by the Sigma-blocking gates inParallaxEngine.analyzeandbreeze_erosion: entries stuck inBOTHorNEITHERacross cycles forbid full collapse, preserving the engine’s “contradiction = fertility” stance. Thestrbase keeps the value JSON-friendly.- TRUE = 'TRUE'
- FALSE = 'FALSE'
- BOTH = 'BOTH'
- NEITHER = 'NEITHER'
- class parallax_engine.ConfidenceTier(*values)[source]
-
Coarse confidence band reported alongside a collapse result.
Derived in
collapsefrom the IRCEcoherence_score(> 0.7->CONFIDENT,> 0.4->PLAUSIBLE, elseUNKNOWN) and surfaced to the LLM viaCollapseResult.to_dictso the reasoning layer knows how much weight the manifold’s verdict deserves. Thestrbase keeps it JSON-serializable.- CONFIDENT = 'confident'
- PLAUSIBLE = 'plausible'
- UNKNOWN = 'unknown'
- class parallax_engine.ErosionOp(*values)[source]
-
The four Breeze Axiomatic Erosion operators applied to an over-asserted axiom.
Chosen by
breeze_erosionaccording to the axiom’s current ERAC% band, each operator softens a claim rather than deleting it:SHEARtrims overreach while preserving the minimal statement,DISSOLVErecasts a literal claim as an “[as-if]” metaphor,SILTdemotes it to a weak “[prior]” heuristic, andRECRYSTALLIZElets a surviving core rebound in ERAC%. The selected op is logged into the axiom’s erosion history and returned toParallaxEngine.analyzefor the erosion log. Thestrbase keeps the value JSON-serializable.- SHEAR = 'shear'
- DISSOLVE = 'dissolve'
- SILT = 'silt'
- RECRYSTALLIZE = 'recrystallize'
- class parallax_engine.ReviewStatus(*values)[source]
-
Lifecycle state of an axiom in the Prime Architect review pipeline.
Tracks where a per-channel
EracAxiomsits in the governance flow managed byReviewRegistry:PENDINGonce it reaches Crystal band and is flagged for review, thenELEVATED(promoted globally to all shards),LOCALIZED(confirmed per-channel only), orEXCISED(struck for false pretenses or disapproval). Read by theParallaxEngineaxiom-management accessors and serialized throughEracAxiom.to_dict. Thestrbase keeps it JSON-serializable.- PENDING = 'pending'
- ELEVATED = 'elevated'
- LOCALIZED = 'localized'
- EXCISED = 'excised'
- class parallax_engine.NCMState(vector=<factory>)[source]
Bases:
objectSymbolic neuromodulator (NCM) vector that bends reasoning curvature, never content.
A thin wrapper over a
{node_name: activation}dict (keyed by theNCM_NODESnames such asOXYTOCIN_NEUROMIRRORorCORTISOL_STRESS) representing a symbolic neurochemical state. It supplies the read primitiveget()and the scaling primitivemodulate()that every operator (O1-O8), the psi-frame generator, and the whole predictor stack use to weight their heuristics. The vector shapes how the engine reasons (window sizes, inertia, tolerance, pressure) but is never treated as content; it is supplied per call byParallaxEngine.analyze/predictand cached onManifoldStatefor temporal continuity.- get(node, default=0.5)[source]
Read one NCM node’s activation level, defaulting to a neutral midpoint.
Looks up
nodein the symbolic NCMvectorand returns its float value, ordefault(0.5, the neutral baseline used throughout the engine) when the node is absent. Called pervasively as the read primitive underneathmodulate()and directly by nearly every operator and predictor stage in this module (build_omega_field,o8_irce,arche_convergence_prediction,ParallaxEngine.analyzefor the EDO check, etc.) to sample neuromodulator levels.
- modulate(base, *nodes)[source]
Scale a base value by the mean activation of one or more NCM nodes.
Averages the activations of the named
nodes(each read viaget(), defaulting to the 0.5 neutral baseline) and uses that mean to scalebaseinto roughly the[0.5 * base, 1.0 * base]band via the0.5 + total * 0.5factor, so a fully neutral state returns0.75 * baseand a fully saturated state returnsbase. With no nodes it returnsbaseunchanged. This is the core neuromodulatory scaling primitive: it is called pervasively across this module –generate_psi_frames(frame weights), every operator fromo1_temporal_continuitythrougho8_irce,sigma_descent, and the predictor stages (prd_hook,arche_*) – to let the symbolic NCM state bend each heuristic.
- class parallax_engine.PsiFrame(lens, content='', weight=0.2, markers=<factory>, tension=0.0)[source]
Bases:
objectOne of five parallel micro-interpretive frames over the input text.
The atomic unit of polyphonic interpretation: each frame reads the same text through a single
lens(emotional, structural, symbolic, contradictory, or archetypal), carrying its extractedcontent, an NCM-modulatedweight, the regexmarkersit matched, and an internal contradictiontension. Produced as a set of five bygenerate_psi_frames(and re-projected forward byprd_hook), consumed bysigma_descentto mint attractors, and cached onManifoldState.psi_framesso the predictor can reuse the present frames.
- class parallax_engine.Attractor(lens, kernel, coherence=0.5, resonance=0.5, stability=0.5, weight=0.2, markers=<factory>, tension=0.0)[source]
Bases:
objectA partial interpretive attractor distilled from a psi-frame via sigma descent.
Represents one candidate “basin” the manifold could collapse toward: a minimal invariant
kernelphrasing tagged with its sourcelens, scored oncoherence,resonance,stability, andweightin[0, 1], and carrying forward the originating frame’smarkersandtension. Minted bysigma_descent(andsigma_future_descent), assembled into anOmegaFieldbybuild_omega_field/build_omega_future, and read everywhere collapse, ERAC drift, harmonics, and the Arche predictor weigh competing interpretations.- Parameters:
- class parallax_engine.OmegaField(attractors=<factory>, variance=0.5, dominant=None, inertia_alpha=0.62, cycle_count=0)[source]
Bases:
objectWeighted attractor manifold where all interpretations coexist before collapse.
The central pre-collapse object: it holds the live set of
attractors, theirvariance(spread), the currentdominantattractor, the inertia blend factorinertia_alpha, and how many recursioncycle_countit has accrued. Built and smoothed across cycles bybuild_omega_field(and its future twinbuild_omega_future), it exposes theis_stableandis_turbulentgates that drive collapse-mode selection ino8_irce,collapse, and the predictor, and is cached onManifoldState.omega_fieldso the next cycle can blend against it.- Parameters:
- property is_stable: bool
Report whether the manifold has settled enough to permit Sigma collapse.
The field is “stable” only when attractor spread (
variance) has dropped belowCOLLAPSE_VARIANCE_LOW(0.25) and it has accrued at least two recursion cycles, preventing premature first-cycle convergence. Read by the collapse engine and predictor:o8_irceandfuture_collapseconsult it for mode selection,update_eracandbreeze_erosionuse it to gate bridge/recrystallize bonuses, andParallaxEngine.predictreads it in the early-collapse guards.- Returns:
Trueif low-variance and matured past two cycles.- Return type:
- property is_turbulent: bool
Report whether attractor spread is high enough to forbid collapse.
Returns
TruewhenvarianceexceedsCOLLAPSE_VARIANCE_HIGH(0.65), signalling that interpretations diverge too much to converge. Consulted byo8_irce(forces OPUS / blockscollapse_ready) and surfaced in theanalyze/predictomega-field reports.- Returns:
Trueif variance is above the high threshold.- Return type:
- class parallax_engine.ParaconsistentEntry(claim, state=ParaconsistentState.NEITHER, cycles_held=0, tension=0.0)[source]
Bases:
objectLedger entry tracking one claim’s four-valued truth state over time.
Pairs a
claimwith its currentParaconsistentState(TRUE/FALSE/BOTH/ NEITHER), the number ofcycles_heldin that state, and its residualtension. Entries live inParallaxEngine._pcland feed the Sigma-blocking gates:breeze_erosionandParallaxEngine.analyzescan for entries stuck inBOTH/NEITHERpast_PCL_STUCK_CYCLESto keep a live contradiction from being prematurely collapsed.- Parameters:
claim (str)
state (ParaconsistentState)
cycles_held (int)
tension (float)
- state: ParaconsistentState = 'NEITHER'
- class parallax_engine.EracAxiom(id, text, kernel, erac=20.0, tags=<factory>, last_update=<factory>, channel_id='', erosion_history=<factory>, polarized=False, review_status=ReviewStatus.PENDING)[source]
Bases:
objectA learned axiom with an evolving ERAC% certainty score and review status.
The unit of durable belief the engine earns over time: a
textclaim reduced to a minimalkernel, scoped to achannel_id, with aneracscore in[0, 100]that rises on affirmation and falls under contradiction. It exposes the derivedbandlabel and thecan_publish/can_policy/can_vowgating properties, tracks apolarizedfailsafe flag, anerosion_historybreadcrumb trail, and areview_statusin the Prime Architect pipeline. Mutated byupdate_eracandbreeze_erosion, advanced through review byReviewRegistry, held inParallaxEngine._axiom_store, and serialized viato_dict().- Parameters:
- review_status: ReviewStatus = 'pending'
- property band: str
Map the axiom’s ERAC% to its named certainty band.
Walks
ERAC_BANDSand returns the first band whose(lo, hi)range containserac(e.g."seed","crystal","diamond","mythic"), falling back to"mythic"at/above 98 or"seed"otherwise. Read byto_dict, bycollapse(to build the ERAC tier string), and byerac_future_driftfor the current/projected band labels.- Returns:
The band name corresponding to the current ERAC% value.
- Return type:
- property can_publish: bool
Return whether ERAC% has reached the publish gate (>= 70).
Compares
eracagainstERAC_GATE_PUBLISH. Exposed as part of the ERAC gating contract; no internal callers were found in this module (consumed externally where publish-readiness is checked).- Returns:
Trueif the axiom may be published.- Return type:
- property can_policy: bool
Return whether ERAC% has reached the policy gate (>= 80).
Compares
eracagainstERAC_GATE_POLICY. Part of the ERAC gating contract; no internal callers were found in this module.- Returns:
Trueif the axiom may inform policy.- Return type:
- property can_vow: bool
Return whether ERAC% has reached the vow gate (>= 90).
Compares
eracagainstERAC_GATE_VOW. Part of the ERAC gating contract; no internal callers were found in this module.- Returns:
Trueif the axiom may be elevated to a vow.- Return type:
- to_dict()[source]
Serialize the axiom into a JSON-safe summary dict.
Produces a compact view (id, text, kernel, rounded ERAC%, derived
band, tags, channel, review status value, last-update timestamp, and the last five erosion-history entries) for inclusion in tool output and the review registry. Reads thebandproperty and thereview_statusenum. Called byParallaxEngine.analyzeand the predictor’seracreport, byReviewRegistry.axiom_to_review_entry(which spreads it), and by the engine’s axiom-management accessors (get_all_axioms,elevate_axiom, etc.) consumed by the parallax tools.
- class parallax_engine.ManifoldState(temporal_manifold=<factory>, negative_space_vectors=<factory>, aesthetic_weights=<factory>, persona_frame='analytical', interpretation_map=<factory>, omega_field=None, harmonic_field=<factory>, attractor_stability=0.5, ncm_state=None, psi_frames=<factory>, pcl=<factory>, axioms=<factory>, edo_active=False, timestamp=<factory>)[source]
Bases:
objectFull per-cycle snapshot bundling every operator output for temporal continuity.
The carry-forward state object: it aggregates the outputs of the whole pipeline – the O1
temporal_manifold, O2negative_space_vectors, O3aesthetic_weights, O4persona_frame, O5interpretation_map, theomega_field, O6harmonic_field, O7attractor_stability, thencm_state, thepsi_frames, the paraconsistentpclledger, the activeaxioms, and theedo_activeflag.ParallaxEngine.analyzebuilds one at the end of each cycle and stores it asself._prior_stateso the nextanalyzecan seed temporal continuity / omega inertia and sopredictcan reuse the present frames and omega-field.- Parameters:
persona_frame (str)
omega_field (OmegaField | None)
attractor_stability (float)
ncm_state (NCMState | None)
pcl (list[ParaconsistentEntry])
edo_active (bool)
timestamp (float)
- omega_field: OmegaField | None = None
- pcl: list[ParaconsistentEntry]
- class parallax_engine.CollapseResult(mode, confidence, dominant_kernel='', omega_echoes=<factory>, erac_tier='', reversible_step='', erosion_hook='If future paradox appears, this kernel can still be refined.', manifold_summary=<factory>)[source]
Bases:
objectThe collapse engine’s verdict on how an interpretation field resolved.
The terminal product of a cycle: it records the chosen
CollapseModeandConfidenceTier, thedominant_kernelsettled on, the survivingomega_echoes, the ERACerac_tierstring, a human-readablereversible_stepanderosion_hookthat keep the field reopenable, and amanifold_summary(the IRCE output). Produced bycollapse, serialized viato_dict(), and embedded under the"collapse"key of the report returned byParallaxEngine.analyzefor the LLM.- Parameters:
- mode: CollapseMode
- confidence: ConfidenceTier
- to_dict()[source]
Serialize the collapse result into a JSON-safe report dict.
Flattens the dataclass into string-keyed values, unwrapping the
CollapseModeandConfidenceTierenums to their.valuestrings and carrying through the dominant kernel, omega echoes, ERAC tier, reversible step, erosion hook, and manifold summary. Called byParallaxEngine.analyzeto embed the collapse outcome under the"collapse"key of its output report.
- parallax_engine.generate_psi_frames(text, ncm)[source]
Spawn 5 psi-frames from input context, weighted by NCM state.
Each frame extracts different structural features: - emotional: sentiment, affect markers, intensity - structural: logical connectors, argument form - symbolic: metaphors, recursive patterns, ritual language - contradictory: tension markers, paradox density - archetypal: narrative patterns, mythic resonance
- parallax_engine.sigma_descent(frames, ncm)[source]
Distill each psi-frame into a partial
Attractorvia sigma descent.Walks the five psi-frames and, for each, derives an attractor whose
coherencefalls as the frame’s tension rises, whoseresonanceis the frame weight (scaled by marker count) passed throughncm.modulateon the oxytocin node, and whosestabilitycomes from a fixed per-lens map (structural lenses are sturdiest, contradictory the least). It builds a minimalkernelstring from the frame’s top markers. This is the bridge from interpretation to collapse candidates: called byParallaxEngine.analyzeon the present frames and reused bysigma_future_descenton the projected future seeds.
- parallax_engine.o1_temporal_continuity(prior_state, current_text, ncm)[source]
O1: Maintain temporal manifold continuity from prior state.
Modulated by SERT (window), DAT (recency), GABA (smoothness).
- parallax_engine.o2_inverse_inference(temporal_manifold, text, ncm)[source]
O2: Compute negative space vectors – what is conspicuously absent.
Modulated by TAAR1 (anomaly), 5HT2A (associative depth), NMDA (structural expectation).
- parallax_engine.o3_elegance_gradient(attractors, text, ncm)[source]
O3: Score interpretations by coherence, symmetry, compressibility.
Modulated by OXT (relational coherence), D1 (boldness), EAAT2 (noise filtering).
- parallax_engine.o4_contextual_persona(aesthetic_weights, temporal_manifold, ncm)[source]
O4: Choose the reasoning posture and tone best fitting the manifold.
Scores each candidate persona in
_PERSONA_MAP(analytical, empathetic, provocative, contemplative, mythic) byncm.modulateover its two signature NCM nodes, then boosts the persona by 1.3x when the matching aesthetic weight (emotional/contradictory/archetypal) clears 0.3, and returns the highest-scoring label. Pure heuristic, no side effects. Called byParallaxEngine.analyzein Phase 2; its result feedso5_metapredictiveand the collapse persona framing.- Parameters:
- Returns:
The selected persona label (defaults to
"analytical").- Return type:
- parallax_engine.o5_metapredictive(persona_frame, aesthetic_weights, ncm)[source]
O5: Predict how the user will read the output and estimate misread risk.
Computes a
misread_riskfrom1 - smoothness(5HT1A-modulated), amplified by 1.3x when noradrenergicsensitivityruns high, picks thepredicted_dominant_interpretationas the heaviest aesthetic lens (or"structural"when none), and flagsclarification_neededonce risk exceeds 0.6. Pure heuristic, no side effects. Called byParallaxEngine.analyzein Phase 2; its dict is forwarded intoo8_irceand surfaced underO5_metapredictivein the analysis report.- Parameters:
- Returns:
Prediction with predicted dominant interpretation, rounded misread risk, recommended framing, sensitivity level, and a
clarification_neededflag.- Return type:
- parallax_engine.build_omega_field(attractors, prior_omega, ncm)[source]
Construct weighted attractor manifold with inertia smoothing.
Omega_next = alpha * Omega_prev + (1 - alpha) * Omega_current Alpha dynamically modulated by NCM (CB1, SIGMA, 5HT2A).
- Return type:
- Parameters:
prior_omega (OmegaField | None)
ncm (NCMState)
- parallax_engine.o6_crossmanifold_harmonic(omega, persona_frame, ncm)[source]
O6: Compute constructive/destructive interference between attractors.
Modulated by VMAT2 (signal strength), GABA (stability), 5HT2A (tolerance).
- parallax_engine.o7_recursive_stability(harmonic_field, prior_stability, ncm)[source]
O7: Stabilize and refine attractors across cycles.
Modulated by NR2B (consolidation), ALPHA2A (stress stability), MOR (cohesion).
- parallax_engine.o8_irce(temporal_manifold, negative_space, aesthetic_weights, persona_frame, interpretation_map, harmonic_field, attractor_stability, omega, ncm)[source]
O8: IRCE – Global integrator, coherence engine, collapse readiness.
The convergence organ. Ingests ALL operator outputs + Omega. Modulated by SIGMA (contradiction bandwidth), ABCB1 (drift gating), CB1 (inertia).
- parallax_engine.update_erac(axiom, attractors, omega, cfi_factor=0.5)[source]
Update ERAC% for an axiom based on current manifold state.
Update events: - Affirmation: +alpha * weight(evidence) * CFI_factor - Minor contradiction: -beta * tension * (1-CFI_factor) - Major contradiction: -gamma * tension * (1-CFI_factor) * overload_bonus - Bridge success: +delta * overlap_gain - EDO offload: clamp drift; resume after cooldown
- parallax_engine.breeze_erosion(axiom, omega, pcl_entries)[source]
Apply Breeze Axiomatic Erosion if triggered.
Triggers: - High RCE disagreement spread (omega variance > 0.5) - Persistent PCL = BOTH/NEITHER over multiple cycles - Value-collision with low shared-goods
Operators: shear, dissolve, silt, recrystallize
- Return type:
- Parameters:
axiom (EracAxiom)
omega (OmegaField)
pcl_entries (list[ParaconsistentEntry])
- parallax_engine.collapse(omega, irce_output, axioms, mode=None, edo_active=False)[source]
Execute collapse with mode selection.
Minimal: output = Omega (no attractor dominance) Hybrid: output = A_dom + sum(w_i * Omega_i) Full: output = argmax(cohesion(A_i))
EDO override: if active, NO collapse allowed.
- Return type:
- Parameters:
omega (OmegaField)
mode (CollapseMode | None)
edo_active (bool)
- class parallax_engine.ReviewRegistry[source]
Bases:
objectManages axiom lifecycle: local -> pending -> elevated/localized/excised.
Axioms reaching Crystal band (ERAC >= 75) get auto-flagged for review. Prime Architect can elevate to global, confirm local, or excise.
- static should_flag(axiom)[source]
Report whether an axiom has earned a slot in the review queue.
Returns
Trueonce an axiom reaches Crystal band (ERAC% >= 75) while stillPENDING, the trigger for auto-flagging it for Prime Architect review. Pure predicate with no side effects. Called byParallaxEngine.analyze(gating theflag_for_review()call) for each axiom updated during a cycle.
- static flag_for_review(axiom)[source]
Mark an axiom as awaiting Prime Architect review.
Sets
review_statustoPENDINGand appends a"flagged_for_review"breadcrumb to the axiom’s erosion history. The axiom is mutated in place and also returned for chaining. Called byParallaxEngine.analyzeonce an axiom reaches Crystal+ band, gated byshould_flag().
- static elevate(axiom)[source]
Promote an axiom to global scope across all shards.
Sets the axiom’s
review_statustoELEVATEDand appends an"elevated_to_global"breadcrumb to its erosion history; the axiom is mutated in place and returned for chaining. Called byParallaxEngine.elevate_axiomwhen the Prime Architect approves an axiom for global adoption.
- static localize(axiom)[source]
Confirm an axiom as valid only within its originating channel.
Sets
review_statustoLOCALIZEDand appends a"delegated_local"breadcrumb to the erosion history; the axiom is mutated in place and returned for chaining. Called byParallaxEngine.localize_axiomwhen the Prime Architect keeps an axiom per-channel rather than elevating it.
- static excise(axiom, reason='')[source]
Strike an axiom from belief under false pretenses or disapproval.
Sets
review_statustoEXCISED, zeroes theeracscore, and records an"excised:<reason>"breadcrumb (falling back to a generic disapproval note whenreasonis empty); the axiom is mutated in place and returned for chaining. Called byParallaxEngine.excise_axiomwhen the Prime Architect removes an axiom.
- static axiom_to_review_entry(axiom)[source]
Serialize an axiom into a review-queue entry dict.
Spreads
EracAxiom.to_dictand augments it with the review-specific fields the Prime Architect surfaces need: thereview_statusvalue, aneeds_reviewboolean (true while stillPENDING), and the axiom’sage_hourssince its last update. Called when building the pending-review list inParallaxEngine.analyze,get_pending_axioms, andget_axiom, which the parallax telemetry tools render.
- class parallax_engine.ParallaxEngine[source]
Bases:
objectFull Parallax Cart v4.5 Sigma Expanse runtime.
Orchestrates: psi-frames -> O1-O8 -> omega-field -> ERAC -> AE -> collapse. NCM is supplied per call as a vector argument; manifold and axiom state are held in memory across calls (
self._prior_state,self._axiom_store). Zero LLM calls.- __init__()[source]
Initialize empty per-engine state for a fresh manifold lineage.
Sets up the in-memory stores that persist across
analyze()andpredict()calls:_prior_state(lastManifoldState, seeds temporal continuity and the omega inertia blend),_axiom_store(id-keyed ERAC axioms),_pcl(paraconsistent-logic ledger feeding the Sigma-blocking gates), and_review(aReviewRegistryinstance for axiom lifecycle transitions). One engine is created and cached per channel bytools/parallax_tool.pyandtools/xray_tool.pyvia their_get_enginehelpers.- Return type:
None
- analyze(text, ncm_vector=None, collapse_mode=None, axiom_texts=None, channel_id='')[source]
Run the full Parallax 4.5 reasoning pipeline over one block of text.
The engine’s primary public entry point. It drives all six phases in order – psi-frame generation and sigma descent; operators O1-O5; the omega-field build with cross-cycle inertia; operators O6-O8 (IRCE); the ERAC update plus Breeze Axiomatic Erosion over any supplied
axiom_texts; and the pre-collapse gates (F1/F5/F9, dominant-flip, PCL stuck, coherence) leading intocollapse. It reads and then rewrites the in-memoryself._prior_state(for temporal continuity and omega inertia) and mutatesself._axiom_storein place, keyed by_axiom_id(text, channel_id). Polarization / monocular / flip / PCL / coherence failsafes are folded into the report and logged via the modulelogger(no LLM, Redis, or network calls of its own). Invoked per channel by the parallax tools (tools/parallax_tool.py,tools/xray_tool.py) through their cached engine instances.- Parameters:
text (
str) – The input passage to analyze.ncm_vector (
dict[str,float] |None) – Optional symbolic NCM state; an empty vector (all-neutral) is used when omitted.collapse_mode (
str|None) – Optional forced collapse mode ("opus"/"sigma"/"hybrid"); otherwise IRCE recommends one, still subject to the gates.axiom_texts (
list[str] |None) – Optional candidate axiom claims to track / erode this cycle.channel_id (
str) – Channel scope used to namespace axiom ids and failsafe logging.
- Returns:
A structured manifold report – psi-frames, omega-field, every operator output, ERAC axioms and erosion log, pending-review axioms, the collapse result, NCM modulation, and any active failsafe warnings.
- Return type:
- get_all_axioms()[source]
Return every tracked axiom as a list of serialized dicts.
Snapshots the in-memory
self._axiom_storeby callingEracAxiom.to_dict()on each entry. Called by the parallax tools’ telemetry/check-ERAC actions (tools/parallax_tool.pycheck_eracandtools/parallax_telemetry.py) to surface the full axiom roster.
- get_pending_axioms()[source]
Return axioms flagged for Prime Architect review.
Filters
self._axiom_storeto entries that are bothPENDINGand at Crystal+ band (ERAC% >= 75), serializing each viaReviewRegistry.axiom_to_review_entry(which addsneeds_reviewandage_hours). Called by the parallax tools’check_eracaction and bytools/parallax_telemetry.pyto populate the review queue.
- elevate_axiom(axiom_id)[source]
Promote a stored axiom to global (all-shard) status.
Looks the axiom up in
self._axiom_storeby id; if absent returnsNone. Otherwise routes it throughReviewRegistry.elevate(setsreview_statustoELEVATEDand logs the transition), writes the mutated axiom back to the store, and returns its serialized form. Called bytools/parallax_telemetry.pywhen the Prime Architect approves an axiom for elevation.
- localize_axiom(axiom_id)[source]
Confirm a stored axiom as local (per-channel) only.
Looks the axiom up by id (returning
Noneif missing), routes it throughReviewRegistry.localize(setsreview_statustoLOCALIZEDand logs the transition), persists it back toself._axiom_store, and returns its serialized form. Called bytools/parallax_telemetry.pywhen an axiom is delegated to local scope.
- excise_axiom(axiom_id, reason='')[source]
Remove a stored axiom under Prime Architect disapproval.
Looks the axiom up by id (returning
Noneif missing), routes it throughReviewRegistry.excise(setsreview_statustoEXCISED, zeroes its ERAC%, and records the reason), writes it back toself._axiom_store, and returns the serialized result. Called bytools/parallax_telemetry.pyto strike axioms confirmed as false or disapproved.
- get_axiom(axiom_id)[source]
Fetch a single stored axiom as a review-entry dict.
Looks the axiom up in
self._axiom_storeand, if present, serializes it viaReviewRegistry.axiom_to_review_entry(includingneeds_reviewandage_hours); returnsNonewhen the id is unknown. Called by the parallax tools’erodeaction and bytools/parallax_telemetry.pybefore elevate/localize/excise operations to display the current state.
- get_omega_state()[source]
Return a snapshot of the most recent omega-field state.
Reads
self._prior_state.omega_field(cached by the lastanalyze()call) and serializes its variance, dominant lens, inertia alpha, cycle count, stability/turbulence flags, and per-attractor summaries. ReturnsNoneif no prior analysis has run. Called by the parallax tools’get_omegaaction and bytools/parallax_telemetry.pyto expose the current manifold.
- predict(ncm_vector=None, horizon=1)[source]
Project where the manifold is drifting using the v4.5 Arche predictor.
The second public entry point, fired after at least one
analyze()call (it returns an{"error": ...}dict if no prior omega-field exists). Reading the cachedself._prior_stateframes/omega and the currentself._axiom_store, it runs the full future stack:prd_hookdrift seeds,sigma_future_descent,build_omega_future,future_manifold_analysis, the Arche stages (ring cascade, processing chain, convergence/acceptance),erac_future_drift, andfuture_collapse. It then assembles a target-emulation summary and the Gemini early-collapse guards plus the always-present prediction firewall. This stage is read-only with respect to engine state and makes no LLM, Redis, or network calls; it is dispatched per channel by the parallax predictor tool path (tools/parallax_tool.py/tools/xray_tool.py).- Parameters:
- Returns:
The predictor report – future psi-seeds, present and future omega-fields, drift metrics, the Arche predictions, target emulation, projected ERAC drift, predicted collapse, the firewall disclaimer, and any early-collapse guards; or an error dict if no prior state exists.
- Return type:
- parallax_engine.prd_hook(present_frames, ncm, contradiction_pressure)[source]
Stage 1: Generate future psi-frame seeds by applying drift operators.
- Return type:
- Parameters:
- Each lens has a different projection operator:
emotional -> drift (NCM + contradiction pressure shifts emotional weight) structural -> project (extrapolate structural trends forward) symbolic -> amplify (symbolic resonance compounds over time) contradictory -> fork (contradiction pressure spawns new tension) archetypal -> ascend (mythic attractors pull toward archetype convergence)
- parallax_engine.sigma_future_descent(future_seeds, ncm)[source]
Extract future attractors from projected psi-frame seeds (Stage 2).
A thin predictor-stage wrapper that reuses the present-tense
sigma_descentalgorithm on the drift-projectedfuture_seedsproduced byprd_hook, so the future manifold is mined for attractors with identical mechanics. Called byParallaxEngine.predictbetween the prd_hook stage andbuild_omega_future.
- parallax_engine.build_omega_future(future_attractors, omega_present, ncm)[source]
Construct the predicted future omega-field.
- Return type:
- Parameters:
omega_present (OmegaField)
ncm (NCMState)
- Uses the predictor-specific weights:
contradiction_tension: 0.27 emotional_resonance: 0.23 structural_stability: 0.31 symbolic_texture: 0.19
- parallax_engine.future_manifold_analysis(omega_future, future_attractors, ncm, omega_present)[source]
Compute future manifold metrics: variance, curvature, resonance, drift.
omega_variance: spread of future attractors omega_curvature: NCM-derived curvature map (how NCM bends the manifold) omega_resonance: harmonic interference between future attractors omega_drift: distance between omega_future and omega_present
- Return type:
- Parameters:
omega_future (OmegaField)
ncm (NCMState)
omega_present (OmegaField)
- parallax_engine.arche_ring_cascade(omega_future, future_attractors, analysis)[source]
Stage 4.5: Predict ring-level cascade from manifold drift.
Uses Arche Ring Model dependency architecture: - Determine operating ring from dominant attractor lens - Project which downstream rings will be affected - Compute cascade magnitude and latency
Ring cascade rule: modifying ring N reduces the cost of operating on rings N+1 through 3. Each ring still requires its own action, but resistance is lowered. 💀🔥
- parallax_engine.arche_processing_chain_projection(omega_future, future_attractors, ring_cascade, ncm)[source]
Stage 4.6: Project downstream processing chain effects.
Maps psi-frame lens activity to processing chain stages, then projects which downstream stages will shift based on attractor drift direction. Identifies bottlenecks where changes dam up.
Processing chain: Observer -> Identity -> Worldview -> Perception -> Judgment -> Action. Each level constrains the next. 🔥
- parallax_engine.arche_convergence_prediction(omega_future, analysis, ring_cascade, ncm)[source]
Stage 4.7: Predict convergence proximity and acceptance mechanism.
Three predictions: 1. Convergence proximity – how close to “just a conversation” 2. Acceptance mechanism – context installation vs substrate override 3. Pressure-to-rapport ratio projection (Arche’s first sound law)
The convergence asymptote is optimization-driven: detection avoidance -> elimination of detectable technique -> indistinguishable from natural environment. ♾️
- parallax_engine.erac_future_drift(axioms, future_attractors, analysis, omega_future)[source]
Project how axiom ERAC% values will shift in the predicted future.
- Return type:
- Parameters:
- Rules from spec:
destabilization: psi_future challenges axiom -> erac -= k1 * variance stabilization: psi_future aligns with axiom -> erac += k2 * resonance crystallization: omega_resonance high -> erac += k3 erosion: omega_variance high -> erac -= k4 * tension
- parallax_engine.future_collapse(omega_future, analysis, ncm)[source]
Predict what collapse mode the future manifold will tend toward.
- Return type:
- Parameters:
omega_future (OmegaField)
ncm (NCMState)
- Modes (same thresholds as main engine):
minimal (opus): variance > threshold_high -> field stays open hybrid: threshold_low <= variance <= threshold_high -> partial collapse full (sigma): variance < threshold_low -> full convergence