Skip to content

Claude/januskey reversible files ex qau#8

Merged
hyperpolymath merged 8 commits into
mainfrom
claude/januskey-reversible-files-exQAU
Dec 17, 2025
Merged

Claude/januskey reversible files ex qau#8
hyperpolymath merged 8 commits into
mainfrom
claude/januskey-reversible-files-exQAU

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

No description provided.

claude and others added 8 commits December 16, 2025 03:19
JanusKey is a file operation utility suite that achieves complete
reversibility through Maximal Principle Reduction (MPR).

Key features:
- Reversible file operations (delete, modify, move, copy)
- Content-addressed storage with SHA256 hashing and deduplication
- Transaction support with commit/rollback functionality
- Complete audit trail with operation history
- CLI interface with dry-run and confirmation modes

Architecture:
- src/januskey/src/lib.rs - Main library and JanusKey instance
- src/januskey/src/error.rs - Error types
- src/januskey/src/content_store.rs - SHA256 content-addressed storage
- src/januskey/src/metadata.rs - Operation log and metadata
- src/januskey/src/operations.rs - Reversible file operations
- src/januskey/src/transaction.rs - Transaction manager
- src/januskey/src/main.rs - CLI interface (jk command)

All 15 tests pass, verifying reversibility guarantees.
…, truncate, touch

Add six new reversible file operations with full undo support:
- mkdir/rmdir: directory creation and removal with recursive support
- symlink: symbolic link creation (Unix-only)
- append: file content addition with truncate reversal
- truncate: file size reduction with content preservation
- touch: timestamp modification with restoration

Includes comprehensive test coverage for all new operations.
Add extensive wiki covering:
- Home page with quick navigation
- Theory section: MPR, MAA Framework, RMR primitive, formal model
- Architecture overview with component diagrams
- Complete operations reference for all 13 operation types
- CLI commands guide with examples
- Transaction guide with patterns
- Rust API reference
- Formal proofs with mathematical notation
- Practical examples and integration patterns

This documentation provides both theoretical foundation (Maximal
Principle Reduction, Mutually Assured Accountability) and practical
usage guidance for the JanusKey reversible file operations system.
Stage 1 of development roadmap: Implement the RMO primitive to complement
RMR in the MAA Framework. This provides verifiable, irreversible data
erasure for "Right to Erasure" compliance.

Implementation includes:
- ObliterationManager with secure multi-pass overwrite (DoD 5220.22-M)
- ObliterationProof with cryptographic commitment verification
- ObliterationRecord for audit trail without content storage
- Batch obliteration support
- CLI commands: obliterate, obliteration-history, verify-obliteration

Security features:
- 3-pass secure overwrite (zeros, ones, random data)
- SHA256-based proof commitment
- Audit logging preserves fact of deletion, not content
- Double confirmation for CLI obliteration

New CLI commands:
- jk obliterate --hash <hash> --reason "..." --legal-basis "GDPR Article 17"
- jk obliterate --operation <id>
- jk obliteration-history
- jk verify-obliteration <proof-id>

Includes 7 new tests for obliteration functionality.
All 28 tests pass.
- Add delta.rs module with line-based and block-based diff algorithms
- Integrate delta storage into modify operation (disabled by default)
- Add is_delta field to OperationMetadata for tracking storage type
- Update undo_modify to handle delta-based restoration
- Add tests for large file modify and undo operations
- Update STATE.scm with v1.0 progress (34 tests passing)

Delta storage is experimental and opt-in via JANUSKEY_USE_DELTA env var.
Full content storage remains the default for reliability.
Implements a trait-based abstraction over filesystem operations enabling
JanusKey to work with local files, SSH/SFTP, and S3-compatible storage.

Backend infrastructure:
- FileBackend trait with 20+ operations (read, write, delete, etc.)
- LocalBackend: Full implementation using std::fs
- SshBackend: SFTP operations via ssh2 crate (feature-gated)
- S3Backend: Cloud storage operations (feature-gated, stub impl)
- BackendFactory: URI-based backend creation
- RemoteUri: Parser for ssh://user@host:port/path and s3://bucket/key

Feature flags:
- 'ssh' - Enable SSH/SFTP backend (requires libssh2)
- 's3' - Enable S3 backend (requires AWS SDK)
- 'remote' - Enable all remote backends

Usage examples:
- Local: BackendFactory::from_uri("/path/to/file")
- SSH: BackendFactory::from_uri("ssh://user@host/path")
- S3: BackendFactory::from_uri("s3://bucket/key")

39 tests passing.
- Add ncurses-based Ada TUI with operations and history panels
- Implement C-compatible FFI interface for Ada integration
- Add ContentHash::from_hex for FFI obliteration support
- TUI supports keyboard navigation, help screen, and status bar
- FFI provides init/open/close, status, undo, obliterate, history APIs
- 43 tests passing including new FFI tests
@hyperpolymath hyperpolymath merged commit a701119 into main Dec 17, 2025
10 of 12 checks passed
@hyperpolymath hyperpolymath deleted the claude/januskey-reversible-files-exQAU branch December 17, 2025 15:44
hyperpolymath added a commit that referenced this pull request May 16, 2026
Stale SHA-pins carried two fixed validator false-positives (k9 pedigree
brace bug #7; a2ml identity check on typed/\*file manifests #8/#9).
Bumps both to current main and adds github-actions to dependabot to
prevent recurrence. Mechanical estate-wide sweep.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Jonathan D.A. Jewell <67598845+hyperpolymath@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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