Skip to content

feat(entropy_ladder): HHTL fork ladder — orthogonal leaf residue → Friston domain fork#221

Merged
AdaWorldAPI merged 3 commits into
masterfrom
claude/jirak-math-theorems-harvest-rfii13
Jun 17, 2026
Merged

feat(entropy_ladder): HHTL fork ladder — orthogonal leaf residue → Friston domain fork#221
AdaWorldAPI merged 3 commits into
masterfrom
claude/jirak-math-theorems-harvest-rfii13

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jun 17, 2026

Copy link
Copy Markdown
Owner

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 shipped Quadrant.

The unification it encodes

Four vocabularies are one 2-axis structure, and every column below is an already-shipped type:

CHALLENGE / surprise / entropy SKILL / engagement / energy
residue_surprise(‖orthogonal leaf residue‖) · materialize::free_energy in-domain codebook capacity · confidence+ATTEND_GAIN
quadrant Csikszentmihalyi mul::FlowState(challenge,skill) Friston fork action
Staunen H↑E↓ Anxiety (challenge≫skill) high F, can't minimize in-model ForkDomain — mint new classid (HHTL shift)
Confusion H↑E↑ Flow/Transition minimizing F actively DescendDeeper / ForkBasin
Boredom H↓E↓ Boredom F already low Commit
Wisdom H↓E↑ resolved Flow F minimized committed fact

entropy_ladder::Quadrantmul::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 over sigma_k·noise_floor.
  • ForkAction {Commit, DescendDeeper, ForkBasin, ForkDomain} + fork_decision(...) — bands the challenge−skill delta exactly like the shipped mul::flow_state_from (Anxiety >0.2, Flow |δ|<0.15, Boredom <-0.2), then HHTL depth decides descend-vs-fork. ForkDomain requires 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 FlowState assessment 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_k are documented as an honest proxy pending a Jirak-derived bound per I-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 that ForkDomain fires only with both leaf depth AND challenge≫skill.

Grade & open joints

  • [G] every composed piece ships (CoarseResidue, Quadrant, FlowState/flow_state_from, classid codebook scoping).
  • [H] that ‖orthogonal residue‖ is the right challenge signal and Anxiety@leaf → ForkDomain the right trigger — falsifiably encoded, not yet validated on real codec residues.
  • [S] new-classid-mint vs sibling-basin: should be arbitrated by residue orthogonality directly; currently a depth+delta proxy.
  • Gated next wire: feed the real edge_codec::CoarseResidue magnitude into fork_decision + stamp the choice into SoA EdgeColumn provenance — merges with lance-graph materialize's ThoughtCtx::from_live step (same call-site).

🤖 Generated with Claude Code


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Implemented fork ladder decision system with challenge assessment for improved entropy handling and adaptive domain exploration strategies
  • Documentation

    • Added architectural documentation describing fork ladder design framework and implementation constraints

claude added 2 commits June 17, 2026 07:54
…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>
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@AdaWorldAPI, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 810522be-8616-4df1-885a-c92c4a87aa94

📥 Commits

Reviewing files that changed from the base of the PR and between eae4321 and 786110a.

📒 Files selected for processing (2)
  • .claude/blackboard.md
  • src/hpc/entropy_ladder.rs
📝 Walkthrough

Walkthrough

Adds a "HHTL fork ladder" layer to src/hpc/entropy_ladder.rs: a residue_surprise function, a ForkAction enum (four variants), and a fork_decision function. Unit tests cover all four actions, surprise ramp/saturation, and Quadrant consistency. A companion blackboard design note documents decomposition, layering rules, and gated loose ends.

Changes

HHTL Fork Ladder

Layer / File(s) Summary
Fork ladder API and decision logic
src/hpc/entropy_ladder.rs
residue_surprise maps residue magnitude to a normalized challenge value with noise-floor clamping. ForkAction declares four discrete outcomes. fork_decision combines challenge-vs-skill band comparisons and leaf-depth gating to select Commit, DescendDeeper, ForkBasin, or ForkDomain.
Unit tests and design notes
src/hpc/entropy_ladder.rs, .claude/blackboard.md
Module tests validate surprise floor ramp, saturation, all four ForkAction outcomes, the domain-fork invariant (leaf depth + strong surprise), and Quadrant::classify alignment. Blackboard records the functional decomposition, quadrant mapping, layering constraints, and loose ends for future wiring.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop, hop, I fork the trail,
When surprise is strong, I blaze new ground,
When challenge shrinks, I just commit and sail,
Basin or domain — the right path found.
Pure functions guide this bunny's decision tree! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: introducing a fork ladder mechanism that maps orthogonal leaf residue to Friston domain forking decisions in the entropy_ladder module.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/hpc/entropy_ladder.rs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between bf606eb and eae4321.

📒 Files selected for processing (2)
  • .claude/blackboard.md
  • src/hpc/entropy_ladder.rs

Comment thread .claude/blackboard.md
Comment thread src/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>
@AdaWorldAPI AdaWorldAPI merged commit 2d5c9bb into master Jun 17, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants