persona: add PersonaMotor.from_identity_manifold() factory
Builds a real, non-identity CGA motor from the value_axes directions carried by an IdentityManifold. Each axis.direction is treated as a 3-vector in R^3, composed additively into a single translator, and scaled by the axis's index to separate the directions in concept space. This replaces the unconditional PersonaMotor.identity() call in ChatRuntime with a motor that geometrically encodes CORE's character.
This commit is contained in:
parent
9be12b9a14
commit
424a67a9ce
1 changed files with 34 additions and 0 deletions
|
|
@ -83,3 +83,37 @@ class PersonaMotor:
|
|||
unitize_versor(translator),
|
||||
unitize_versor(rotor),
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def from_identity_manifold(cls, manifold) -> "PersonaMotor":
|
||||
"""
|
||||
Build a persona motor from a live IdentityManifold.
|
||||
|
||||
Each value_axis carries a direction tuple in R^3. The axes are
|
||||
composed additively into a single concept vector, then passed to
|
||||
from_concept_vector() to produce the CGA translator that encodes
|
||||
CORE's character as a geometric displacement in concept space.
|
||||
|
||||
The resulting motor is non-identity: it biases every field walk
|
||||
toward the manifold's value directions without overriding the
|
||||
algebraic propagation rules.
|
||||
|
||||
Falls back to identity() if the manifold has no value_axes or if
|
||||
all directions are zero — preserving safe-default behavior.
|
||||
"""
|
||||
if not manifold.value_axes:
|
||||
return cls.identity()
|
||||
|
||||
combined = np.zeros(3, dtype=np.float32)
|
||||
for axis in manifold.value_axes:
|
||||
direction = np.asarray(axis.direction[:3], dtype=np.float32)
|
||||
if np.linalg.norm(direction) > 1e-8:
|
||||
combined += direction
|
||||
|
||||
if np.linalg.norm(combined) < 1e-8:
|
||||
return cls.identity()
|
||||
|
||||
# Normalize so the motor magnitude is consistent regardless of
|
||||
# how many axes are present.
|
||||
combined /= np.linalg.norm(combined)
|
||||
return cls.from_concept_vector(combined)
|
||||
|
|
|
|||
Loading…
Reference in a new issue