Skip to content

Extend the undo/redo model: state the stack laws in Agda and widen the operation set #237

Open

Description

@hyperpolymath

Follow-up to #231 (2026-11-17). Read CLAUDE.md (Proof policy), .claude/CLAUDE.md, docs/ECHO-TYPES-OCHRANCE-BRIDGE.adoc and docs/audits/2026-11-01-assurance-boundary-audit.adoc first.

Where things stand

Work, in order

Report after each step if a statement turns out false.

  1. Agda. State the undo/redo stack and both round-trip laws (undo then redo; redo then undo; n-fold) under agda --safe --without-K --cubical-compatible, in proofs/agda/, added to All.agda. Make operations carry their undo payload, so that "the redone record equals the original record" can be stated.
  2. Widen the operation set to what the Rust history holds (OperationType in impl/rust-cli/src/state.rs): copy, move, symlink/unlink, chmod, chown, truncate, append. Add nested directories if the path model allows, and say plainly if it does not.
  3. Recheck legs. Restate in Lean 4 and Rocq only what was proved in Agda, recorded as target-only evidence until compared.
  4. Ledger. Update EXPLAINME.adoc#proof-ledger with the closed status vocabulary. No percentages.

Constraints

  • Do not add reversible-core or any januskey/absolute-zero import.
  • Do not treat a model theorem as a statement about the Rust code. The Rust round trip stays tested-only.
  • Never report a proof as checked unless the checker ran and exited 0 in that session.
  • Commits signed.

Cross-repository notes (for the PR description; not to act on from this repository)

  • hyperpolymath/januskey: PROOF-NEEDS.adoc lists "reversible-core: Undo/redo preserves data integrity", and its own audit (docs/reports/audit/proof-statement-audit-2026-10-27.adoc, section 6) says no redo exists in the code. ReversibleExecutor has execute and undo but no redo. These laws are candidate statements for that claim.
  • hyperpolymath/absolute-zero: the CNO form is undo ; redo ≡ CNO and redo ; undo ≡ CNO on the history state, not only on the filesystem.

Tools

Agda 2.7.0.1 with stdlib v2.2. Idris2 0.8.0 built from source needs Chez Scheme and libgmp-dev.

Related: #79 (Agda theorem candidates), #93 (Lean → Rust correspondence).

Activity

  1. added
    enhancementNew capability or improvement to existing behaviour
    proofsFormal verification: Agda, Coq, Idris, Lean, Z3/SMT, axiom debt
    scope:repoConfined to this repository
    on Nov 17, 2026
  2. coderabbitai commented on Nov 17, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #231 - Fix redo: redone operations keep their undo data, and redo restores what the operation produced [open]
    #230 - Stress-suite repair and a crash-safe history journal (two steps still open, not ready to merge) [open]
    #222 - docs(plans): proof-first route plan, architecture and ultracode session plan [closed]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew capability or improvement to existing behaviourpriority:p3Low - nice to haveproofsFormal verification: Agda, Coq, Idris, Lean, Z3/SMT, axiom debtscope:repoConfined to this repository

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions