feat(entropy_ladder): HHTL fork ladder — orthogonal leaf residue → Friston domain fork#221
Conversation
…iston domain fork
Reduction-to-practice of a standing idea: if the orthogonal (helix/CAM-PQ)
leaf residue is strong enough, free energy forks into another domain (an HHTL
shift = new exploration). Unifies four vocabularies that are one 2-axis
structure: entropy×energy Quadrant ≡ Csikszentmihalyi FlowState(challenge,skill)
≡ Friston model-vs-surprise ≡ Staunen↔Wisdom.
- residue_surprise(mag, noise_floor, sigma_k): maps the orthogonal residue
magnitude (the prediction error the in-domain centroid codebook fails to
explain) to the challenge axis [0,1]. Below the noise floor = quantization
(≈0); linear ramp to saturation over sigma_k·noise_floor. Threshold
provenance per I-NOISE-FLOOR-JIRAK (Berry-Esseen wrong under CAM-PQ weak
dependence); the ramp is an honest proxy pending Jirak calibration, not a
claimed bound.
- ForkAction {Commit, DescendDeeper, ForkBasin, ForkDomain} + fork_decision(...):
bands the challenge−skill delta exactly like the shipped mul::flow_state_from
(Anxiety >0.2, Flow |d|<0.15, Boredom <-0.2), then HHTL depth decides
descend-vs-fork. ForkDomain (mint a new classid domain = the Friston
model-switch) requires BOTH leaf depth AND challenge≫skill — the operator's
"strong enough AT THE LEAF" invariant.
Pure functions + one enum; no new struct/layer; composes with the existing
Quadrant. 5 new lib tests + 2 doctests, including a cross-check that an
Anxiety/ForkDomain residue lands in the high-entropy (Staunen/Confusion) half
of the shipped Quadrant. clippy clean.
Co-Authored-By: Claude <noreply@anthropic.com>
Per the ndarray agent protocol (update blackboard after completing work): log the entropy_ladder fork-ladder addition, the four-vocabulary unification, the honest [S] joints (real CoarseResidue feed, orthogonality arbitration, Jirak σ), and that the driver-side wire merges with lance-graph materialize's from_live step. Co-Authored-By: Claude <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 52 minutes and 31 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a "HHTL fork ladder" layer to ChangesHHTL Fork Ladder
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eae4321ddd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/blackboard.md:
- Around line 6-41: The blackboard documentation on lines 23-24 contains a
threshold value "Flow |δ|<0.15" that does not match the actual implementation
which uses 0.2 for the Flow state boundary. Update the threshold value in the
documentation from 0.15 to 0.2 to align with the actual fork_decision
implementation threshold, ensuring the documented behavior accurately reflects
the code behavior in the residue_surprise and ForkAction logic.
In `@src/hpc/entropy_ladder.rs`:
- Around line 279-331: The documentation for the fork_decision function states
that the Flow decision band uses |δ|<0.15 to match flow_state_from, but the
actual implementation uses threshold values of 0.2 (on lines comparing delta >
0.2 and delta < -0.2). Verify which threshold value (0.15 or 0.2) is correct by
checking the shipped flow_state_from function, then align both the threshold
constants in the fork_decision function body and the documented specification in
the doc comment to use the same consistent value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 33ea00e6-0bc3-4105-9655-5b16c3cd8622
📒 Files selected for processing (2)
.claude/blackboard.mdsrc/hpc/entropy_ladder.rs
…old accuracy PR #221 review: - Codex P2: residue_surprise returned NaN when noise_floor·sigma_k are both zero/non-positive — MIN_POSITIVE² underflows to 0.0, so a below-floor residue hit 0.0/0.0. Floor the span AFTER the multiply so the result is always finite and in [0,1]; the NaN otherwise defeated fork_decision's ±0.2 bands. Added a degenerate-calibration finiteness regression test. - CodeRabbit: the fork_decision doc + blackboard claimed the bands match flow_state_from "exactly (Flow |δ|<0.15)", but the implementation uses the ±0.2 Anxiety/Boredom boundaries and collapses Flow+Transition into one in-domain branch. Corrected both docs to state the implemented bands accurately (Anxiety δ>0.2, Boredom δ<-0.2, matched middle |δ|≤0.2 resolves in-domain). Code unchanged — the ±0.2 thresholds already match flow_state_from. 12 lib + 7 doctests green, clippy clean. Co-Authored-By: Claude <noreply@anthropic.com>
What
Reduction-to-practice of a standing operator idea: if the orthogonal (helix/CAM-PQ) leaf residue is strong enough, free energy forks into another domain — an HHTL shift into a new exploration. Pure functions added beside the existing entropy/quadrant code in
hpc::entropy_ladder; no new struct/layer, composes with the shippedQuadrant.The unification it encodes
Four vocabularies are one 2-axis structure, and every column below is an already-shipped type:
residue_surprise(‖orthogonal leaf residue‖)·materialize::free_energyconfidence+ATTEND_GAINmul::FlowState(challenge,skill)entropy_ladder::Quadrant≡mul::FlowState≡ Friston model-vs-surprise ≡ Staunen↔Wisdom.API
residue_surprise(mag, noise_floor, sigma_k) → [0,1]— maps the orthogonal residue magnitude (the prediction error the in-domain centroid codebook fails to explain; the component ⊥ the assigned centroid after the "place" is subtracted) to the challenge axis. Below the floor → quantization (≈0); linear ramp to saturation oversigma_k·noise_floor.ForkAction {Commit, DescendDeeper, ForkBasin, ForkDomain}+fork_decision(...)— bands thechallenge−skilldelta exactly like the shippedmul::flow_state_from(Anxiety>0.2, Flow|δ|<0.15, Boredom<-0.2), then HHTL depth decides descend-vs-fork.ForkDomainrequires BOTH leaf depth AND challenge≫skill — the operator's "strong enough at the leaf" invariant (a strong residue at a coarse tier descends first).Layering (kept honest)
The
FlowStateassessment stays in lance-graph (mul.rs, thinking layer); the fork math lives here in ndarray (substrate, where residue + energy physically are) — per the Architecture Rule. ndarray = mechanism, consumer = policy.Threshold provenance
noise_floor/sigma_kare documented as an honest proxy pending a Jirak-derived bound perI-NOISE-FLOOR-JIRAK(classic Berry-Esseen is wrong under CAM-PQ weak dependence) — not a claimed bound.Tests
5 new lib tests + 2 doctests (all green, clippy clean), including a cross-check that an Anxiety/ForkDomain residue lands in the high-entropy (Staunen/Confusion) half of the shipped
Quadrant, and thatForkDomainfires only with both leaf depth AND challenge≫skill.Grade & open joints
CoarseResidue,Quadrant,FlowState/flow_state_from, classid codebook scoping).‖orthogonal residue‖is the right challenge signal andAnxiety@leaf → ForkDomainthe right trigger — falsifiably encoded, not yet validated on real codec residues.edge_codec::CoarseResiduemagnitude intofork_decision+ stamp the choice into SoA EdgeColumn provenance — merges with lance-graphmaterialize'sThoughtCtx::from_livestep (same call-site).🤖 Generated with Claude Code
Generated by Claude Code
Summary by CodeRabbit
New Features
Documentation