Skip to content

Prune settled payout tree nodes#1092

Merged
0xaslan merged 20 commits into
mainfrom
at/predict-open-items
Jun 30, 2026
Merged

Prune settled payout tree nodes#1092
0xaslan merged 20 commits into
mainfrom
at/predict-open-items

Conversation

@0xaslan

@0xaslan 0xaslan commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Prune fully zeroed payout-tree boundary nodes during remove, merging child subtrees so traversal tracks active boundaries instead of all-time touched ticks.
  • Add test-only node inspection and update payout-tree/walk tests to assert physical reclamation and adjacent live-boundary cancellation.

Key decisions

  • Keep walk_linear exact by default; this change removes zero-node bloat without changing the interpolation policy.
  • Keep the broader active-book sizing/gas cap concern separate because a genuinely huge live book can still be expensive.

Test plan

  • git diff --check
  • git diff --cached --check
  • sui move build --path packages/predict --warnings-are-errors
  • sui move test --path packages/predict --gas-limit 100000000000

@0xaslan 0xaslan force-pushed the at/predict-open-items branch from 8cc297a to 8d9a1c0 Compare June 27, 2026 16:40
@0xaslan 0xaslan force-pushed the at/predict-open-items branch from 8d9a1c0 to 839863a Compare June 27, 2026 16:42
0xaslan and others added 14 commits June 27, 2026 13:17
…vidence-backed rules

Scope: Predict cluster only (no deepbook-core changes); docs/skill files only, no Move source.

Rule files:
- move.md: rewrite Predict-Economics to static-floor knockout (drop terminal_floor_index /
  floor_index / time-varying-floor / opened_at_ms-in-id; static F, quantity - floor_shares,
  exact NAV = Sum qty*P - Sum min(qty*P,F), knock-out level, lambda buffer) -- verified at HEAD.
  Add: Open-Closed/irreversibility, loop-hoist preservation, guard-preservation across
  extraction, unbounded-permissionless-state-in-aggregation, owner-auth fallback for terminal
  exits, defer-and-carry; return-struct default + Data-Clump (2-3, not 4+); trust-boundary
  carve-out to non-redundancy; two-sided + recoverable safety bounds.
- code-review.md: add loop-hoist regression check.
- unit-tests.md: Rule 4 -> reachable-only + testability-as-design; Rule 15 -> fix dangling
  .redesign/BUGS_FOUND.md path to .claude/predict-review/OPEN-ITEMS.md.
- CLAUDE.md: re-aim the Predict-economics gate at the current settled list; flag the journal as
  historical; separate NAV-supersession from the still-live D030 backing axis; state knockout.

predict-audit skill (kept Predict-scoped):
- SKILL.md/primer.md: fix scope to the 4 Predict-cluster packages (not deepbook core);
  migration out of scope.
- primer.md/lens 01/defi-invariant-classes.md: reframe live-backing / aggregate-NAV to static
  Q-F + lambda / knock-out-level.
- ownership-rules.md: R2 drops opened_at_ms; R5 adds the trust-boundary carve-out.
- move-sui-audit-checklist.md: add Refactor & API-surface safety section.
- rule-sweep.workflow.js: recalibrate test-coverage family (reachable-only + testability;
  drop stale .move.disabled note).

Verified at HEAD: terminal_floor_index/floor_index = 0 occurrences, backing_buffer_lambda exists,
0 .move.disabled files. (The matching ROUNDING_POLICY.md R1-scope edit stays local --
.claude/predict-design/ is gitignored.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@tonylee08 tonylee08 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lgtm but let's include public function param changes like redeem_settled in PR description

@0xaslan 0xaslan merged commit a784aec into main Jun 30, 2026
6 checks passed
@0xaslan 0xaslan deleted the at/predict-open-items branch June 30, 2026 12:23
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