Implements the coupled forward-correction loop that separates CORE from
a nearest-neighbour lookup engine:
per iteration:
state, Δ_fwd = diffusion_op.forward(state) # spread context
state, Δ_corr = correction_op.adjoint_pass(state) # enforce intent
converged when both Δ_fwd < ε and Δ_corr < ε
field/operators.py:
- Add ConstraintCorrectionOperator(target_versor, correction_rate, node_index)
- adjoint_pass() builds an incremental correction rotor from the current
output-node versor toward the intent target using the exponential map
(same _unitize_f32 path, same boost/rotation blade classification).
This is a non-self-adjoint operator: it has a preferred direction.
- forward() is identity (correction acts only on the output node via adjoint_pass).
- The target is the prompt centroid versor — same geometry that seeds the
output node, so the correction restores coherence broken by diffusion.
scripts/run_pulse.py (V4):
- Build target_versor from prompt centroid before the loop (exposed from
_build_manifold as a second return value alongside state + labels).
- Instantiate GraphDiffusionOperator + ConstraintCorrectionOperator.
- Coupled convergence: loop until both Δ_fwd < ε AND Δ_corr < ε.
- Print both deltas each step for observability.
- --correction-rate flag (default 0.3) to tune correction strength.
- --no-correction flag to reproduce V3 pure-diffusion behaviour.
tests/test_pulse_integration.py:
- test_correction_pulls_toward_target: verifies output node moves closer
to target versor under correction than without it.
- test_coupled_loop_converges: full V4 pulse with correction converges.
- test_correction_rate_zero_is_identity: rate=0 leaves the field unchanged.
- test_different_inputs_produce_different_correction_targets: correction
targets differ for semantically distinct inputs.
Replace the divergent rotation-based diffusion operator with a linear
blend + exponential-map re-unitization approach that converges in ~28
steps while maintaining vc < 1e-6.
Key changes:
- GraphDiffusionOperator now averages neighbors in multivector space and
re-projects via per-plane exponentials (cos/sin for rotations, cosh/sinh
for boosts in Cl(4,1))
- run_pulse V3: per-token graph topology with input-driven output node,
recall via VocabManifold.nearest(), --no-glove flag for compiled pack
- Tests updated for V3 API
Different inputs now produce different recall rankings from the compiled
en_core_cognition_v1 vocabulary, completing Threshold 1 (Semantic Encoding).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ManifoldState (N,32) versor field over graph edges, GraphDiffusionOperator
with damped convergence via construction_seed_versor closure, deterministic
hash-to-versor stub, and run_pulse.py end-to-end script proving injection →
propagation → vault recall → token output. 24 new tests, zero regressions
on architectural invariants.
Three items from the post-assessment stabilization slice:
1. field/state.py: restore frozen=True, slots=True
slots=True closes __dict__ on FieldState instances, preventing
incidental attribute injection that frozen=True alone does not block.
The holonomy field works cleanly with slots because ndarray | None
is a valid slotted field type in Python 3.12.
2. README.md: correct vocab/ layer description
Was: 'Word-to-versor manifold, edge rotors'
Now: 'Surface-token manifold points; indexed access for algebraic
transition construction'
Edge rotors are constructed by algebra/, not stored in vocab/.
This exact confusion caused vocab.edge_rotor() drift in earlier work.
3. AGENTS.md: add language-pack checksum rule
Manifest checksums MUST be computed by reading back the bytes
written to disk (Path(f).read_bytes()), never from in-memory strings
before serialization. Unicode-escaped JSON on disk != Python str.
Three surgical import changes. No behavior change. No new semantics.
Backend decides Rust vs pure-Python transparently.
- field/propagate.py: versor_apply <- algebra.backend
- vocab/manifold.py: cga_inner <- algebra.backend
- vault/store.py: recall loop replaced with vault_recall() from
algebra.backend; public result shape preserved ({versor, score,
metadata, index}). null_project stays on algebra.cga (not the
recall hot path). store() and reproject() unchanged.
Rust path for vault_recall uses Rayon parallel scan and releases
the GIL. Python fallback is sequential and behaviorally identical.
No batching introduced; that is Commit 3+.
- field/state.py: FieldState is now frozen+slotted; constructor copies and
enforces float32 shape (32,); advance() updated to pass raw arrays.
np.ndarray inside frozen dataclass is ref-frozen — copy() at construction
is the explicit contract boundary.
- generate/result.py: NEW — GenerationResult frozen dataclass carrying
tokens + final_state. Async variant yields tokens and exposes final_state
on completion.
- generate/stream.py: generate() now returns GenerationResult, not list[str].
vocab.edge_rotor() call replaced with:
A = vocab.get_versor_at(current.node)
B = vocab.get_versor_at(word_idx)
V = word_transition_rotor(A, B)
agenerate() updated to yield tokens and surface final_state.
- vocab/manifold.py: added get_versor_at(idx) and get_word_at(idx) indexed
accessors. VocabManifold stores points; algebra constructs operators.
normalize_to_versor() call-site in docstring clarified: callers must call
unitize_versor() (algebra construction primitive) before add(), not
normalize_to_versor() directly.
- algebra/versor.py: unitize_versor() added as the explicit construction-time
primitive. normalize_to_versor() kept but marked internal/gate-only.
Distinction encoded in docstrings and __all__.
- persona/motor.py + ingest/gate.py: SessionContext.respond() is not yet in
the repo as a separate file; gate.py docstring updated to reflect the
three-tier normalization doctrine:
unitize_versor() — algebra construction only
inject() — gate, once per raw input
normalization — forbidden in propagate/generate/vault recall