Skip to content

Add Safe owner list invariants research page#17

Open
Th0rgal wants to merge 13 commits intomainfrom
add-safe-owner-reachability-page
Open

Add Safe owner list invariants research page#17
Th0rgal wants to merge 13 commits intomainfrom
add-safe-owner-reachability-page

Conversation

@Th0rgal
Copy link
Copy Markdown
Member

@Th0rgal Th0rgal commented Apr 9, 2026

Summary

  • Adds a new research case study page at /research/safe-owner-reachability for the Safe OwnerManager linked list invariants
  • Covers all four ownership-mutating functions: setupOwners, addOwner, removeOwner, swapOwner
  • Three invariant families: inListReachable (forward reachability), ownerListInvariant (combined biconditional), and acyclic (no cycles)
  • Creates a SafeGuarantee component with English/formal notation toggle showing the ownerListInvariant biconditional
  • Includes a proof status table (1 proven, 11 open benchmark tasks for AI agents)
  • Registers the new page in data/research.js
  • Introduces getSortedResearch() for consistent date-sorted research lists
  • Refactors Lido page to use shared Hypothesis component
  • Adds CI workflow (.github/workflows/ci.yml)

The page covers:

  • The invariants: reachability, biconditional membership, and acyclicity for the Safe OwnerManager linked list
  • Why it matters: structural integrity of the Safe multisig owner list across all ownership operations
  • How it was proven: witness chains, chain lifting, and chain prepending in Lean 4 via Verity
  • Proof status: addOwner inListReachable is proven; 11 theorems are open benchmark tasks
  • Hypotheses: all hypotheses documented with expandable details, including provable structural properties (acyclic, freshInList)
  • Verify it yourself: build command for independent verification

Aligned with verity-benchmark PR #18 which extends the Safe case to model all four functions and adds the new invariant families.

Test plan

  • next build succeeds with the new page
  • Visual review of /research/safe-owner-reachability
  • Verify research index page lists the new entry
  • Check "More research" section at bottom filters correctly

Note

Low Risk
Low risk: primarily adds new content/pages and small UI refactors; the only behavioral change is consistently date-sorting research lists and introducing a CI build step.

Overview
Adds a new research case study page at /research/safe-owner-reachability, including a SafeGuarantee English/formal toggle and a shared Hypothesis disclosure UI.

Introduces getSortedResearch() and updates the research index and existing research pages to use the date-sorted list for the “More research” sections. Registers the new entry in data/research.js and refactors the Lido page to import the shared Hypothesis component.

Adds a GitHub Actions CI workflow (.github/workflows/ci.yml) that installs with Bun, restores the Next.js cache, and runs bun run build on PRs and main pushes.

Reviewed by Cursor Bugbot for commit 33f9da6. Bugbot is set up for automated code reviews on this repo. Configure here.

New case study page for the formally verified inListReachable invariant
of the Safe OwnerManager linked list, proven using Verity and Lean 4.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lfglabs-dev Ready Ready Preview, Comment Apr 10, 2026 8:46am

Request Review

</div>
</div>
)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SafeGuarantee duplicates Guarantee toggle logic and structure

Low Severity

SafeGuarantee is a near-complete copy of Guarantee — the state management (useState, useRef, useEffect with 5-second timer), handleToggle handler, toggle button with identical SVG icon, and the grid-based opacity-swap layout are all line-for-line identical. Only the inner content and one label string ("Switch to formal" vs "Switch to math") differ. A shared wrapper component accepting the formal/English content, toggle label, and Lean link as props would eliminate ~60 lines of duplication and make future case study pages trivial to add.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 934c77e. Configure here.

Reflects verity-benchmark PR #18 which extends the Safe case from
addOwner-only to all four ownership-mutating functions (setupOwners,
addOwner, removeOwner, swapOwner) and three invariant families
(inListReachable, ownerListInvariant, acyclicity).

Key changes:
- Title broadened to "Safe Owner List Invariants"
- SafeGuarantee now shows the ownerListInvariant biconditional
- "What these invariants cover" lists all three invariant families
- "How this was proven" describes all four function models
- Added proof status table (1 proven, 11 open benchmark tasks)
- Hypotheses updated: added hPrevLink (GS205), hClean (setupOwners),
  reclassified hAcyclic and hFreshInList as provable properties
- Links updated for new Specs.lean line numbers and OpenProofs.lean

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Th0rgal Th0rgal changed the title Add Safe owner list reachability invariant research page Add Safe owner list invariants research page Apr 9, 2026
Display inListReachable, ownerListInvariant, and acyclic as a
stacked list with English/formal toggle. Each invariant label
links to its definition in Specs.lean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 25a1c88. Configure here.

- Extract shared Hypothesis component from duplicated code in both
  research pages (bugbot fix)
- Move safe-owner-reachability to top of research list as newest entry
  (bugbot fix)
- Update page content: all 4 functions modeled (setupOwners, addOwner,
  removeOwner, swapOwner), 6/6 benchmark proofs complete
- Update SafeGuarantee to show ownerListInvariant (biconditional)
  instead of just inListReachable
- Add proof status table, stronglyAcyclic hypothesis, and updated
  hypothesis descriptions (hOwnerInList, hOldNePrev, hStrongAcyclic)
- Update page title and metadata to "Safe Owner List Invariants"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The INVARIANTS-based multi-row layout uses plain <a> tags for
invariant labels, so ExternalLinkIcon is no longer referenced.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reflects the new stronglyAcyclic definition (antisymmetry of
reachability) added in verity-benchmark PR #18, which captures
Certora's reach_invariant axiom and is required by removeOwner
and swapOwner proofs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The table was showing only 6 benchmark tasks and incorrectly
listing removeOwner/swapOwner acyclicity and setupOwners
ownerListInvariant as open. Cross-referencing Proofs.lean (0 sorry)
shows 9 theorems are proven. Only 3 ownerListInvariant preservation
theorems (addOwner, removeOwner, swapOwner) remain open.

Switched to a compact function x invariant grid matching the
actual proof state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- SafeGuarantee: English summary wording, formal-only math (no Lean names),
  centered sizing tuned vs Lido hero
- Page: disclosure lists four invariants; prose and links (OwnerManager.sol,
  Verity Contract.lean); remove em dashes; How this was proven intro ties
  Verity model to Solidity source

Made-with: Cursor
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